Package: iproute
Version: 20061002-3
Severity: minor
Tags: patch

The 'wrandom' multipath algo is recognised when adding the route, but
not resolved when it is printed (prints 'unknown'):

ianus:~# ip ro add 1.2.3.4 mpath wrandom nexthop dev ppp0 weight 1 nexthop dev 
ppp1 weight 2
ianus:~# ip ro get to 1.2.3.4
1.2.3.4 mpath unknown dev ppp0  src 62.77.192.67 
    cache  mtu 1492 advmss 1452 hoplimit 64
ianus:~# ip ro del 1.2.3.4 mpath wrandom nexthop dev ppp0 weight 1 nexthop dev 
ppp1 weight 2

It works with all the other multipath algos:

ianus:~# ip ro add 1.2.3.4 mpath random nexthop dev ppp0 weight 1 nexthop dev 
ppp1 weight 2
ianus:~# ip ro get to 1.2.3.4
1.2.3.4 mpath random dev ppp1  src 62.77.192.67 
    cache  mtu 1492 advmss 1452 hoplimit 64
ianus:~# ip ro del 1.2.3.4 mpath random nexthop dev ppp0 weight 1 nexthop dev 
ppp1 weight 2

The cause is that 'wrandom' is the last element in the ip_mp_alg enum,
so IP_MP_ALG_MAX == IP_MP_ALG_WRANDOM. All the other code (including
kernel code) treats IP_MP_ALG_MAX as the last valid value of the enum,
except iproute-20061002/ip/iproute.c: It assumes that IP_MP_ALG_MAX is
the last valid value plus 1. The same bug exists in upstream
(http://developer.osdl.org/dev/iproute2/download/iproute2-2.6.20-070313.tar.gz).

Best regards,

norbi


-- System Information:
Debian Release: 4.0
  APT prefers oldstable
  APT policy: (500, 'oldstable'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18
Locale: LANG=C, LC_CTYPE=hu_HU (charmap=ISO-8859-2)

Versions of packages iproute depends on:
ii  libatm1                     2.4.1-17     shared library for ATM (Asynchrono
ii  libc6                       2.3.6.ds1-13 GNU C Library: Shared libraries
ii  libdb4.3                    4.3.29-8     Berkeley v4.3 Database Libraries [

Versions of packages iproute recommends:
pn  iproute-doc                   <none>     (no description available)

-- no debconf information
diff -Naur iproute-20061002/ip/iproute.c iproute-20061002.fixed/ip/iproute.c
--- iproute-20061002/ip/iproute.c       2007-06-11 19:26:52.000000000 +0200
+++ iproute-20061002.fixed/ip/iproute.c 2007-06-11 19:27:29.000000000 +0200
@@ -358,7 +358,7 @@
                __u32 mp_alg = *(__u32*) RTA_DATA(tb[RTA_MP_ALGO]);
                if (mp_alg > IP_MP_ALG_NONE) {
                        fprintf(fp, "mpath %s ",
-                           mp_alg < IP_MP_ALG_MAX ? mp_alg_names[mp_alg] : 
"unknown");
+                           mp_alg <= IP_MP_ALG_MAX ? mp_alg_names[mp_alg] : 
"unknown");
                }
        }
 

Reply via email to