1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-24 08:29:04 +00:00

On windows, the --iflist option was not reporting correct windevice values and not displaying all ethernet devices if the user had interface aliases set up. Now all Windevice values and interface device ID's will be properly linked together.

This commit is contained in:
michael
2008-06-03 18:05:45 +00:00
parent c20b232ebc
commit 9f64691427
2 changed files with 20 additions and 8 deletions

View File

@@ -341,13 +341,21 @@ int print_iflist(void) {
Tbl->addItem(0, 0, false, "DEV");
Tbl->addItem(0, 1, false, "WINDEVICE");
i = numifs;
for(p_iface_iter = p_ifaces; p_iface_iter != NULL && i >= 1; i--) {
Tbl->addItem(i, 0, false, iflist[i-1].devname);
Tbl->addItem(i, 1, false, p_iface_iter->name);
p_iface_iter = p_iface_iter->next;
}
{
//the previous interface that we printed to screen
char * lastface="";
//Now print off all the interfaces, we check to make sure we dont print any duplicate interfaces.
//In the case of an interface alias, iflist will have a double entry but p_iface_iter
//will only have one. So we check to make sure we only print out one copy of each hardware interface.
for(p_iface_iter = p_ifaces; p_iface_iter != NULL && i >= 1; i--) {
if(strcmp(lastface,iflist[i-1].devname)!=0){
Tbl->addItem(i, 0, false, iflist[i-1].devname);
Tbl->addItem(i, 1, false, p_iface_iter->name);
p_iface_iter = p_iface_iter->next;
lastface = iflist[i-1].devname;
}
}
}
log_write(LOG_PLAIN, "%s\n", Tbl->printableTable(NULL));
log_flush_all();
delete Tbl;