mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix returned error when deleting non-existant address
PiperOrigin-RevId: 340149214
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user