Nmap Development mailing list archives

Re: lingering problem: route_dst_netlink: can't find interface


From: David Fifield <david () bamsoftware com>
Date: Mon, 10 Sep 2012 12:55:17 -0700

On Tue, Aug 28, 2012 at 12:44:12PM +0100, Djalal Harouni wrote:
Hi,

Thanks for sending all that info.

Please see below (I'm not familiar with IP-over-InfiniBand interfaces)

On Thu, Aug 23, 2012 at 08:51:27PM -0400, starlight.2012q3 () binnacle cx wrote:
So it seems to be a problem with 'libdnet'
failing when it sees an Infiniband
interface.  Built latest and ran test:

$ dnet intf show
lo: flags=0x3<UP,LOOPBACK> mtu 16436
        inet 127.0.0.1/8
        alias ::1
sit0: flags=0x8<NOARP> mtu 1480
lt-dnet: intf_loop: Invalid argument

Runs ok on an nearly identical CentOS 5.8
system that has no IB interfaces.

Reported this to 'libdnet' owner/maintainer.
Yes libdnet does not handle this. Plus these IPoIB (IP-over-InfiniBand)
use 20bytes for hardware address, and current libdnet code can store only
upto 16bytes, and I'm not sure how other parts of libdnet will deal
with this.


Another point is can we send ethernet frames in this case ? or only IP
packets ? which I suppose can be handled by the '--send-ip' Nmap switch.

Anyway you can start with the attached patch, and see if it will work,
only 6bytes of hardware address will be reported.

Please try to see if you can send IP packets with Nmap on that interface.

Index: libdnet-stripped/include/dnet/arp.h
===================================================================
--- libdnet-stripped/include/dnet/arp.h       (revision 29679)
+++ libdnet-stripped/include/dnet/arp.h       (working copy)
@@ -39,6 +39,7 @@
 #define ARP_HRD_ETH  0x0001  /* ethernet hardware */
 #define ARP_HRD_IEEE802      0x0006  /* IEEE 802 hardware */
 
+#define ARP_HRD_INFINIBAND 0x0020 /* InfiniBand */
 #define ARP_HRD_IEEE80211_RADIOTAP 0x0323  /* IEEE 802.11 + radiotap header */
 #define ARP_HRD_VOID 0xFFFF                  /* Void type, nothing is known */
 
Index: libdnet-stripped/src/addr.c
===================================================================
--- libdnet-stripped/src/addr.c       (revision 29679)
+++ libdnet-stripped/src/addr.c       (working copy)
@@ -319,6 +319,7 @@
      case AF_UNSPEC:
      case ARP_HRD_ETH:       /* XXX- Linux arp(7) */
      case ARP_HRD_IEEE80211_RADIOTAP: /* IEEE 802.11 + radiotap header */
+     case ARP_HRD_INFINIBAND: /* InfiniBand */
              a->addr_type = ADDR_TYPE_ETH;
              a->addr_bits = ETH_ADDR_BITS;
              memcpy(&a->addr_eth, sa->sa_data, ETH_ADDR_LEN);

This looks okay to me. Please apply it, Djalal. Also please add a
comment stating that only 6 of the 20 bytes of the hardware address are
captured, and link to this thread.

David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: