aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitsuru Chinen <mitch@linux.vnet.ibm.com>2007-04-05 02:54:59 -0400
committerDavid S. Miller <davem@davemloft.net>2007-04-05 02:54:59 -0400
commit60e5c166413f17d5ef00b4c1f398dbd44291309a (patch)
tree1aeeb716dbd027b3f29ee2058c3d7c1041b5e3ae
parent75559c167bddc1254db5bcff032ad5eed8bd6f4a (diff)
[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>
-rw-r--r--net/ipv6/ip6_input.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index 11bfc7c43182..61e7a6c8141d 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -108,8 +108,10 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
108 108
109 /* pkt_len may be zero if Jumbo payload option is present */ 109 /* pkt_len may be zero if Jumbo payload option is present */
110 if (pkt_len || hdr->nexthdr != NEXTHDR_HOP) { 110 if (pkt_len || hdr->nexthdr != NEXTHDR_HOP) {
111 if (pkt_len + sizeof(struct ipv6hdr) > skb->len) 111 if (pkt_len + sizeof(struct ipv6hdr) > skb->len) {
112 goto truncated; 112 IP6_INC_STATS_BH(idev, IPSTATS_MIB_INTRUNCATEDPKTS);
113 goto drop;
114 }
113 if (pskb_trim_rcsum(skb, pkt_len + sizeof(struct ipv6hdr))) { 115 if (pskb_trim_rcsum(skb, pkt_len + sizeof(struct ipv6hdr))) {
114 IP6_INC_STATS_BH(idev, IPSTATS_MIB_INHDRERRORS); 116 IP6_INC_STATS_BH(idev, IPSTATS_MIB_INHDRERRORS);
115 goto drop; 117 goto drop;
@@ -128,8 +130,6 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
128 rcu_read_unlock(); 130 rcu_read_unlock();
129 131
130 return NF_HOOK(PF_INET6,NF_IP6_PRE_ROUTING, skb, dev, NULL, ip6_rcv_finish); 132 return NF_HOOK(PF_INET6,NF_IP6_PRE_ROUTING, skb, dev, NULL, ip6_rcv_finish);
131truncated:
132 IP6_INC_STATS_BH(idev, IPSTATS_MIB_INTRUNCATEDPKTS);
133err: 133err:
134 IP6_INC_STATS_BH(idev, IPSTATS_MIB_INHDRERRORS); 134 IP6_INC_STATS_BH(idev, IPSTATS_MIB_INHDRERRORS);
135drop: 135drop: