]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/commitdiff
The ip(8) command has a bug when dealing with IPoIB link layer
authorshemminger <shemminger>
Tue, 21 Mar 2006 23:57:50 +0000 (23:57 +0000)
committershemminger <shemminger>
Tue, 21 Mar 2006 23:57:50 +0000 (23:57 +0000)
addresses. Specifically it does not correctly handle the addition of
new entries in the neighbor/arp table. For example, this command will
fail:

ip neigh add 192.168.0.138 lladdr
00:00:04:04:fe:80:00:00:00:00:00:00:00:01:73:00:00:00:8a:91 nud
permanent dev ib0

An IPoIB link layer address is 20-bytes (see
http://www.ietf.org/internet-drafts/draft-ietf-ipoib-ip-over-infiniband-09.txt,
section 9.1.1).

The command line parsing code expects link layer addresses to be a
maximum of 16-bytes. Addresses over 16-bytes are truncated.

ChangeLog
ip/iplink.c
ip/ipneigh.c

index f9eb6520967f081d5f9d033bc304099a1cae0971..27d4c1b0aeb2dc28bee51d8204830d62feaf88cd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-03-21  James Lentini <jlentini@netapp.com>
+       
+       * Increase size of hw address allowed for ip neigh to allow
+         for IB.
+
 2006-03-14  Russell Stuart <russell-lartc@stuart.id.au>
        
        * Fix missing memset in tc sample
index 77b1eeaef75a76984d8ed38a1b1609ef19c788d1..ffc9f063200723bb794bbeccfedae0f2aa9f5207 100644 (file)
@@ -216,7 +216,8 @@ static int get_address(const char *dev, int *htype)
        return me.sll_halen;
 }
 
-static int parse_address(const char *dev, int hatype, int halen, char *lla, struct ifreq *ifr)
+static int parse_address(const char *dev, int hatype, int halen, 
+               char *lla, struct ifreq *ifr)
 {
        int alen;
 
index 9e12befc3ba43201b01b9239a83889a5ed734649..249ee680b036de267ef6e13933b63e4682fa5fdc 100644 (file)
@@ -165,7 +165,7 @@ static int ipneigh_modify(int cmd, int flags, int argc, char **argv)
        addattr_l(&req.n, sizeof(req), NDA_DST, &dst.data, dst.bytelen);
 
        if (lla && strcmp(lla, "null")) {
-               char llabuf[16];
+               char llabuf[20];
                int l;
 
                l = ll_addr_a2n(llabuf, sizeof(llabuf), lla);