• Benjamin Thery's avatar
    net: /proc/net/ip_mr_cache, display Iif as a signed short · 999890b2
    Benjamin Thery authored
    Today, iproute2 fails to show multicast forwarding unresolved cache
    entries while scanning /proc/net/ip_mr_cache.
    
    Indeed, it expects to see -1 in 'Iif' column to identify unresolved
    entries but the kernel outputs 65535. It's a signed/unsigned issue:
    
    'Iif', the source interface, is retrieved from member mfc_parent in
    struct mfc_cache. mfc_parent is a vifi_t: unsigned short, but is
    displayed in ipmr_mfc_seq_show() as "%-3d", signed integer.
    
    In unresolevd entries, the 65535 value (0xFFFF) comes from this define:
    #define ALL_VIFS    ((vifi_t)(-1))
    
    That may explains why the guy who added support for this in iproute2
    thought a -1 should be expected.
    
    I don't know if this must be fixed in kernel or in iproute2. Who is
    right? What is the correct API? How was it designed originally?
    
    I let you decide if it should goes in the kernel or be fixed in iproute2.
    Signed-off-by: default avatarBenjamin Thery <benjamin.thery@bull.net>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    999890b2
ipmr.c 44 KB