]> git.baikalelectronics.ru Git - kernel.git/commit
udp: Fix the SNMP counter of UDP_MIB_INDATAGRAMS
authorWei Yongjun <yjwei@cn.fujitsu.com>
Sun, 2 Nov 2008 16:11:01 +0000 (16:11 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Nov 2008 07:52:45 +0000 (23:52 -0800)
commit7031d9321228d544edf1949c7c00281c91cb1e94
treeabb81ca460a07a99852f9c579d4c3324faacc801
parentac36f2fcf3c9f01124c7272ac5aa60d6871a65f7
udp: Fix the SNMP counter of UDP_MIB_INDATAGRAMS

If UDP echo is sent to xinetd/echo-dgram, the UDP reply will be received
at the sender. But the SNMP counter of UDP_MIB_INDATAGRAMS will be not
increased, UDP6_MIB_INDATAGRAMS will be increased instead.

  Endpoint A                      Endpoint B
  UDP Echo request ----------->
  (IPv4, Dst port=7)
                   <----------    UDP Echo Reply
                                  (IPv4, Src port=7)

This bug is come from this patch adf62df292c714a1e6f04593813894180721ac7e.

It do counter UDP[6]_MIB_INDATAGRAMS until udp[v6]_recvmsg. Because
xinetd used IPv6 socket to receive UDP messages, thus, when received
UDP packet, the UDP6_MIB_INDATAGRAMS will be increased in function
udpv6_recvmsg() even if the packet is a IPv4 UDP packet.

This patch fixed the problem.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/udp.c