diff options
author | Benjamin Thery <benjamin.thery@bull.net> | 2008-12-04 01:22:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-04 01:22:16 -0500 |
commit | 999890b21a8eff7559a140fcbd2cd4b34e685c76 (patch) | |
tree | 83f0c7fbb43e562c40cce760666d69de653abcf0 /net/ipv6/ip6mr.c | |
parent | 1ea472e2dedcf23d5f31c63fc790cccfab93c0de (diff) |
net: /proc/net/ip_mr_cache, display Iif as a signed short
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: Benjamin Thery <benjamin.thery@bull.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6mr.c')
-rw-r--r-- | net/ipv6/ip6mr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 2dc4b0190878..1446bec895a2 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
@@ -297,7 +297,7 @@ static int ipmr_mfc_seq_show(struct seq_file *seq, void *v) | |||
297 | const struct mfc6_cache *mfc = v; | 297 | const struct mfc6_cache *mfc = v; |
298 | const struct ipmr_mfc_iter *it = seq->private; | 298 | const struct ipmr_mfc_iter *it = seq->private; |
299 | 299 | ||
300 | seq_printf(seq, "%pI6 %pI6 %-3d", | 300 | seq_printf(seq, "%pI6 %pI6 %-3hd", |
301 | &mfc->mf6c_mcastgrp, &mfc->mf6c_origin, | 301 | &mfc->mf6c_mcastgrp, &mfc->mf6c_origin, |
302 | mfc->mf6c_parent); | 302 | mfc->mf6c_parent); |
303 | 303 | ||