1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-09 06:56:35 +00:00

Consolidate and improve error checks for missing source MAC. See #2711

This commit is contained in:
dmiller
2026-01-28 21:36:15 +00:00
parent a5b332ccd2
commit c1d16550dc
8 changed files with 61 additions and 49 deletions

View File

@@ -1168,7 +1168,6 @@ int raw_socket_or_eth(int sendpref, const char *ifname, devtype iftype,
try_ip = may_try_ip;
netutil_eth_t *e = eth_open_cached(ifname);
*ethsd = e;
if (e == NULL) {
netutil_error("dnet: failed to open device %s", ifname);
}
@@ -1177,6 +1176,7 @@ int raw_socket_or_eth(int sendpref, const char *ifname, devtype iftype,
e = NULL;
}
else {
*ethsd = e;
break;
}
}
@@ -1194,8 +1194,8 @@ int raw_socket_or_eth(int sendpref, const char *ifname, devtype iftype,
}
#endif
int sd = netutil_raw_socket(ifname);
*rawsd = sd;
if (sd >= 0) {
*rawsd = sd;
break;
}
}