--- nmap/tcpip.cc +++ nmap/tcpip.cc @@ -2694,8 +2694,8 @@ bool setTargetNextHopMAC(Target *target) { /* OK, the last choice is to send our own damn ARP request (and retransmissions if necessary) to determine the MAC */ target->SourceSockAddr(&srcss, NULL); - if (doArp(target->deviceName(), target->SrcMACAddress(), &srcss, &targetss, - mac)) { + if (doArp(target->deviceFullName(), target->SrcMACAddress(), + &srcss, &targetss, mac)) { NmapArpCache(ARPCACHE_SET, &targetss, mac); target->setNextHopMACAddress(mac); return true; @@ -3143,6 +3143,16 @@ static struct sys_route *getsysroutes_proc(FILE *routefp, int *howmany) { break; } } + /* If device name in the route file does not match any interface, then + try to find at least an alias of interface that matches. */ + if (i == numifaces) { + for(i=0; i < numifaces; i++) { + if (!strcmp(iface, ifaces[i].devname)) { + routes[numroutes].device = &ifaces[i]; + break; + } + } + } if (i == numifaces) { error("Failed to find device %s which was referenced in /proc/net/route", iface); continue; --- nmap/idle_scan.cc +++ nmap/idle_scan.cc @@ -406,7 +406,7 @@ static void initialize_idleproxy(struct idle_proxy_info *proxy, char *proxyName, Snprintf(filter, sizeof(filter), "tcp and src host %s and dst host %s and src port %hu", p, q, proxy->probe_port); free(p); free(q); - set_pcap_filter(proxy->host.deviceName(), proxy->pd, filter); + set_pcap_filter(proxy->host.deviceFullName(), proxy->pd, filter); /* Windows nonsense -- I am not sure why this is needed, but I should get rid of it at sometime */ --- nmap/osscan2.cc +++ nmap/osscan2.cc @@ -3266,7 +3266,7 @@ static void begin_sniffer(HostOsScan *HOS, vector &Targets) { filterlen = len; if (o.debugging > 2) log_write(LOG_PLAIN, "Pcap filter: %s\n", pcap_filter); - set_pcap_filter(Targets[0]->deviceName(), HOS->pd, pcap_filter); + set_pcap_filter(Targets[0]->deviceFullName(), HOS->pd, pcap_filter); return; } --- nmap/scan_engine.cc +++ nmap/scan_engine.cc @@ -5071,7 +5071,7 @@ static void begin_sniffer(UltraScanInfo *USI, vector &Targets) { } }else assert(0); if (o.debugging > 2) log_write(LOG_PLAIN, "Pcap filter: %s\n", pcap_filter.c_str()); - set_pcap_filter(Targets[0]->deviceName(), USI->pd, pcap_filter.c_str()); + set_pcap_filter(Targets[0]->deviceFullName(), USI->pd, pcap_filter.c_str()); /* pcap_setnonblock(USI->pd, 1, NULL); */ return; }