dhclient: Skip things that don't have hardware addresses

This commit is contained in:
K. Lange 2021-10-22 15:35:37 +09:00
parent 0cdb536ef5
commit 3ff2a31248

View File

@ -262,7 +262,10 @@ static int configure_interface(const char * if_name) {
return 1;
}
if (ioctl(netdev, SIOCGIFHWADDR, &mac_addr)) {
int res = ioctl(netdev, SIOCGIFHWADDR, &mac_addr);
if (res == 1) return 0; /* Loopback, skip */
if (res) {
fprintf(stderr, "%s: %s: could not get mac address\n", _argv_0, if_name);
return 1;
}