Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libdnet: distinguish more correctly between Ethernet and non-Ethernet interfaces #372

Open
dmiller-nmap opened this issue Apr 25, 2016 · 0 comments
Labels

Comments

@dmiller-nmap
Copy link

Libdnet has a function, _intf_set_type, that is used to determine the interface type:

/* XXX - this is total crap. how to do this without walking ifnet? */
static void
_intf_set_type(struct intf_entry *entry)
{
  if ((entry->intf_flags & INTF_FLAG_LOOPBACK) != 0)
    entry->intf_type = INTF_TYPE_LOOPBACK;
  else if ((entry->intf_flags & INTF_FLAG_BROADCAST) != 0)
    entry->intf_type = INTF_TYPE_ETH;
  else if ((entry->intf_flags & INTF_FLAG_POINTOPOINT) != 0)
    entry->intf_type = INTF_TYPE_TUN;
  else
    entry->intf_type = INTF_TYPE_OTHER;
}

The primary problem that Nmap has with this method is that it detects some types of interfaces (IEEE1394 network, Infiniband, etc) as Ethernet based on the broadcast flag, when they are NOT Ethernet. IEEE1394, for instance, uses a different type of ARP protocol. It should be a fatal error to try to send an Ethernet frame on these interface types, but it should work just fine to do most scanning. Right now, the workaround is for the user to specify --send-ip for those interfaces. Better detection at this point in libdnet would make it "just work."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant