On Tue, Nov 20, 2007 at 07:16:26AM -0000, Rob Nicholls wrote:
> But perhaps it solves the problem that GV has mentioned (and I suspect is a
> separate problem to mine). It does, however, appear to change --iflist quite
> a lot as it no longer shows any interfaces that are down (e.g. my Broadcom
> gigabit Ethernet adapter that's enabled but doesn't currently have a network
> cable plugged into it):
>
> David, was that intentional? All previous versions of nmap that I can
> remember have listed the down interfaces too.
No, that wasn't intentional. I misunderstood part of the previous code.
But it might have been in error anyway:
for(i=0; i < (int) entry->intf_alias_num; i++) {
if (entry->intf_alias_addrs[i].addr_type == ADDR_TYPE_IP) {
addr_ntos(&entry->intf_alias_addrs[i], (struct sockaddr *) &dcrn->ifaces[numifaces].addr);
dcrn->ifaces[numifaces].netmask_bits = entry->intf_alias_addrs[i].addr_bits;
break;
}
if (i == (int) entry->intf_alias_num)
return 0; /* No IPv4 addresses found for this interface */
}
If I'm not mistaken the test (i == (int) entry->intf_alias_num) can
never be true, so execution always continues after the loop. I don't
know if that's what it's supposed to do or not. Anyway, the attached
patch will hopefully fix the interface alias issue and report interfaces
with --iflist in the same way as before, i.e., showing down interfaces.
I also attached a cumulative patch so you can see how this patch differs
from the last one.
David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org
Received on Nov 20 2007