Fix returned error when deleting non-existant address

PiperOrigin-RevId: 340149214
This commit is contained in:
Ian Lewis
2020-11-01 18:03:43 -08:00
committed by gVisor bot
parent df88f223bb
commit 5e606844df
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -487,7 +487,7 @@ func (p *Protocol) delAddr(ctx context.Context, msg *netlink.Message, ms *netlin
Addr: value,
})
if err != nil {
return syserr.ErrInvalidArgument
return syserr.ErrBadLocalAddress
}
case linux.IFA_ADDRESS:
default:
+1 -1
View File
@@ -536,7 +536,7 @@ TEST(NetlinkRouteTest, AddAndRemoveAddr) {
// Second delete should fail, as address no longer exists.
EXPECT_THAT(LinkDelLocalAddr(loopback_link.index, AF_INET,
/*prefixlen=*/24, &addr, sizeof(addr)),
PosixErrorIs(EINVAL, ::testing::_));
PosixErrorIs(EADDRNOTAVAIL, ::testing::_));
});
// Replace an existing address should succeed.