Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[IPv6]: Exclude truncated packets from InHdrErrors statistics

Incoming trancated packets are counted as not only InTruncatedPkts but
also InHdrErrors. They should be counted as InTruncatedPkts only.

Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Mitsuru Chinen and committed by
David S. Miller
60e5c166 75559c16

+4 -4
+4 -4
net/ipv6/ip6_input.c
··· 108 108 109 109 /* pkt_len may be zero if Jumbo payload option is present */ 110 110 if (pkt_len || hdr->nexthdr != NEXTHDR_HOP) { 111 - if (pkt_len + sizeof(struct ipv6hdr) > skb->len) 112 - goto truncated; 111 + if (pkt_len + sizeof(struct ipv6hdr) > skb->len) { 112 + IP6_INC_STATS_BH(idev, IPSTATS_MIB_INTRUNCATEDPKTS); 113 + goto drop; 114 + } 113 115 if (pskb_trim_rcsum(skb, pkt_len + sizeof(struct ipv6hdr))) { 114 116 IP6_INC_STATS_BH(idev, IPSTATS_MIB_INHDRERRORS); 115 117 goto drop; ··· 130 128 rcu_read_unlock(); 131 129 132 130 return NF_HOOK(PF_INET6,NF_IP6_PRE_ROUTING, skb, dev, NULL, ip6_rcv_finish); 133 - truncated: 134 - IP6_INC_STATS_BH(idev, IPSTATS_MIB_INTRUNCATEDPKTS); 135 131 err: 136 132 IP6_INC_STATS_BH(idev, IPSTATS_MIB_INHDRERRORS); 137 133 drop: