ethernet: Fix some more incorrect return value handlings of ioctl().

This commit is contained in:
Augustin Cavalier 2018-09-13 16:14:36 -04:00
parent 4d5c5a7e66
commit 62a788f323

View File

@ -400,7 +400,9 @@ ethernet_add_multicast(struct net_device *_device, const sockaddr *_address)
if (address->sdl_type != IFT_ETHER)
return B_BAD_VALUE;
return ioctl(device->fd, ETHER_ADDMULTI, LLADDR(address), 6);
if (ioctl(device->fd, ETHER_ADDMULTI, LLADDR(address), 6) < 0)
return errno;
return B_OK;
}
@ -416,7 +418,9 @@ ethernet_remove_multicast(struct net_device *_device, const sockaddr *_address)
if (address->sdl_type != IFT_ETHER)
return B_BAD_VALUE;
return ioctl(device->fd, ETHER_REMMULTI, LLADDR(address), 6);
if (ioctl(device->fd, ETHER_REMMULTI, LLADDR(address), 6) < 0)
return errno;
return B_OK;
}