linux/net/ipv4
Benjamin Thery 1ea472e2de net: fix /proc/net/ip_mr_cache display - V2
/proc/net/ip_mr_cache and /proc/net/ip6_mr_cache displays garbage when
showing unresolved mfc_cache entries.

[root@qemu tests]# cat /proc/net/ip_mr_cache
Group    Origin   Iif     Pkts    Bytes    Wrong Oifs
014C00EF 010014AC 1         10    10050        0  2:1    3:1
024C00EF 010014AC 65535      514        2 -559067475

The first line is correct. It is a resolved cache entry, 10 packets used it...
The second line represents an unresolved entry, and the columns Pkts(4th),
Bytes(5th) and Wrong(6th) just show garbage.

In struct mfc_cache, there's an union to store data for resolved and
unresolved cases. And what ipmr_mfc_seq_show() is printing in these 
columns for the unresolved entries is some bytes from mfc_cache.mfc_un.res.
Bad.
(eg. In our case -559067475 is in fact 0xdead4ead which is the spinlock
magic from mfc_cache.mfc_un.unres.unresolved.lock.magic).

This patch replaces the garbage data written in these columns for the
unresolved entries by '0' (zeros) which is more correct.
This change doesn't break the ABI.

Also, mfc->mfc_un.res.pkt, mfc->mfc_un.res.bytes, mfc->mfc_un.res.wrong_if
are unsigned long.

It applies on top of net-next-2.6.

The patch for net-2.6 is slightly different because of the NIP6_FMT to
%pI6 conversion that was made in the seq_printf.

Changelog:
==========
V2:
* Instead of breaking the ABI by suppressing the columns that have no
  meaning for unresolved entries, fill them with 0 values.

Signed-off-by: Benjamin Thery <benjamin.thery@bull.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-03 22:21:47 -08:00
..
netfilter netfilter: nf_nat: remove warn_if_extra_mangle 2008-11-04 14:35:39 +01:00
Kconfig
Makefile
af_inet.c net: some optimizations in af_inet 2008-11-23 15:42:23 -08:00
ah4.c netns xfrm: AH/ESP in netns! 2008-11-25 17:59:27 -08:00
arp.c ipv4: Fix ARP behavior with many mac-vlans 2008-11-16 19:19:38 -08:00
cipso_ipv4.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-10-31 00:17:34 -07:00
datagram.c
devinet.c net: clean up net/ipv4/devinet.c 2008-11-03 02:48:48 -08:00
esp4.c netns xfrm: AH/ESP in netns! 2008-11-25 17:59:27 -08:00
fib_frontend.c net: clean up net/ipv4/fib_frontend.c fib_hash.c ip_gre.c 2008-11-03 00:25:16 -08:00
fib_hash.c net: clean up net/ipv4/fib_frontend.c fib_hash.c ip_gre.c 2008-11-03 00:25:16 -08:00
fib_lookup.h
fib_rules.c
fib_semantics.c net: clean up net/ipv4/ah4.c esp4.c fib_semantics.c inet_connection_sock.c inetpeer.c ip_output.c 2008-11-03 00:23:42 -08:00
fib_trie.c net: replace NIPQUAD() in net/ipv4/ net/ipv6/ 2008-10-31 00:53:57 -07:00
icmp.c netns xfrm: lookup in netns 2008-11-25 17:35:18 -08:00
igmp.c net: clean up net/ipv4/igmp.c 2008-11-03 00:26:09 -08:00
inet_connection_sock.c net: percpu_counter_inc() should not be called in BH-disabled section 2008-12-01 23:37:17 -08:00
inet_diag.c net: Convert TCP/DCCP listening hash tables to use RCU 2008-11-23 17:22:55 -08:00
inet_fragment.c
inet_hashtables.c net: Make sure BHs are disabled in sock_prot_inuse_add() 2008-11-24 00:09:29 -08:00
inet_lro.c include/net net/ - csum_partial - remove unnecessary casts 2008-11-19 15:44:53 -08:00
inet_timewait_sock.c net: convert TCP/DCCP ehash rwlocks to spinlocks 2008-11-20 20:39:09 -08:00
inetpeer.c net: clean up net/ipv4/ah4.c esp4.c fib_semantics.c inet_connection_sock.c inetpeer.c ip_output.c 2008-11-03 00:23:42 -08:00
ip_forward.c net: reduce structures when XFRM=n 2008-10-28 13:24:06 -07:00
ip_fragment.c net: '&' redux 2008-11-03 18:21:05 -08:00
ip_gre.c net: fix tunnels in netns after ndo_ changes 2008-11-23 17:26:26 -08:00
ip_input.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-11-18 23:38:23 -08:00
ip_options.c cipso: Add support for native local labeling and fixup mapping names 2008-10-10 10:16:34 -04:00
ip_output.c net: avoid a pair of dst_hold()/dst_release() in ip_push_pending_frames() 2008-11-24 16:07:50 -08:00
ip_sockglue.c net: ip_sockglue.c add static, annotate ports' endianness 2008-11-20 01:54:27 -08:00
ipcomp.c netns xfrm: state lookup in netns 2008-11-25 17:30:50 -08:00
ipconfig.c net: replace NIPQUAD() in net/ipv4/ net/ipv6/ 2008-10-31 00:53:57 -07:00
ipip.c net: fix tunnels in netns after ndo_ changes 2008-11-23 17:26:26 -08:00
ipmr.c net: fix /proc/net/ip_mr_cache display - V2 2008-12-03 22:21:47 -08:00
netfilter.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6 2008-11-28 02:19:15 -08:00
proc.c net: Use a percpu_counter for orphan_count 2008-11-25 21:17:14 -08:00
protocol.c
raw.c net: avoid a pair of dst_hold()/dst_release() in ip_append_data() 2008-11-24 15:52:46 -08:00
route.c netns xfrm: lookup in netns 2008-11-25 17:35:18 -08:00
syncookies.c
sysctl_net_ipv4.c net: '&' redux 2008-11-03 18:21:05 -08:00
tcp.c net: Use a percpu_counter for orphan_count 2008-11-25 21:17:14 -08:00
tcp_bic.c
tcp_cong.c net: Remove CONFIG_KMOD from net/ (towards removing CONFIG_KMOD entirely) 2008-10-16 15:24:51 -07:00
tcp_cubic.c [TCP] CUBIC v2.3 2008-11-02 00:28:10 -07:00
tcp_diag.c net: inet_diag_handler structs can be const 2008-11-19 15:43:27 -08:00
tcp_highspeed.c
tcp_htcp.c tcp_htcp: last_cong bug fix 2008-11-12 01:41:09 -08:00
tcp_hybla.c
tcp_illinois.c
tcp_input.c tcp: tcp_limit_reno_sacked can become static 2008-11-25 13:45:29 -08:00
tcp_ipv4.c net: Use a percpu_counter for sockets_allocated 2008-11-25 21:16:35 -08:00
tcp_lp.c
tcp_minisocks.c net: clean up net/ipv4/ipip.c raw.c tcp.c tcp_minisocks.c tcp_yeah.c xfrm4_policy.c 2008-11-03 00:24:34 -08:00
tcp_output.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-11-26 23:48:40 -08:00
tcp_probe.c net: replace NIPQUAD() in net/ipv4/ net/ipv6/ 2008-10-31 00:53:57 -07:00
tcp_scalable.c
tcp_timer.c net: Use a percpu_counter for orphan_count 2008-11-25 21:17:14 -08:00
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c net: clean up net/ipv4/ipip.c raw.c tcp.c tcp_minisocks.c tcp_yeah.c xfrm4_policy.c 2008-11-03 00:24:34 -08:00
tunnel4.c
udp.c net: udp_unhash() can test if sk is hashed 2008-11-25 13:55:15 -08:00
udp_impl.h udp: introduce struct udp_table and multiple spinlocks 2008-10-29 01:41:45 -07:00
udplite.c udp: RCU handling for Unicast packets. 2008-10-29 02:11:14 -07:00
xfrm4_input.c
xfrm4_mode_beet.c
xfrm4_mode_transport.c
xfrm4_mode_tunnel.c
xfrm4_output.c
xfrm4_policy.c netns xfrm: ->get_saddr in netns 2008-11-25 17:56:49 -08:00
xfrm4_state.c xfrm: remove useless forward declarations 2008-11-25 01:05:54 -08:00
xfrm4_tunnel.c