Skip to contentSkip to conversation

SNMPv2 "ipFragFails" counter error

PATCH weidong 2 participants 2 messages Aug 31, 2006

Subsystems (3)
lore
Share & tools
lore

weidong

author
#0 lore raw

Hi, All
When I tested Linux kernel 2.6.17.7 about statistics
"ipFragFails",found that this counter couldn't increase correctly. The criteria is RFC2011:
RFC2011
ipFragFails OBJECT-TYPE

    SYNTAX      Counter32
    MAX-ACCESS  read-only
    STATUS      current

DESCRIPTION
"The number of IP datagrams that have been discarded because they needed to be fragmented at this entity but could not be, e.g., because their Don't Fragment flag was set."
::= { ip 18 }

When I send big IP packet to a router with DF bit set to 1 which need to be fragmented, and router just sends an ICMP error message ICMP_FRAG_NEEDED but no increments for this counter(in the function ip_fragment).

net/ipv4/ip_output.c +1 -0
diff -ruN old/net/ipv4/ip_output.c new/net/ipv4/ip_output.c
@@ -441,6 +441,7 @@
 	iph = skb->nh.iph;
 
 	if (unlikely((iph->frag_off & htons(IP_DF)) && !skb->local_df)) {
+		IP_INC_STATS(IPSTATS_MIB_FRAGFAILS);
 		icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
 			  htonl(dst_mtu(&rt->u.dst)));
 		kfree_skb(skb);
maintainer
#1 lore raw

From: weidong <[email protected]>
Date: Fri, 01 Sep 2006 10:39:35 -0400

Quoted 15 lines

Hi, All
When I tested Linux kernel 2.6.17.7 about statistics
"ipFragFails",found that this counter couldn't increase correctly. The criteria is RFC2011:
RFC2011
ipFragFails OBJECT-TYPE

    SYNTAX      Counter32
    MAX-ACCESS  read-only
    STATUS      current

DESCRIPTION
"The number of IP datagrams that have been discarded because they needed to be fragmented at this entity but could not be, e.g., because their Don't Fragment flag was set."
::= { ip 18 }

Quoted 6 lines

When I send big IP packet to a router with DF bit set to 1 which need to be fragmented, and router just sends an ICMP error message ICMP_FRAG_NEEDED but no increments for this counter(in the function ip_fragment).

Patch applied, thank you very much.