• S
    ipv6: Don't increase IPSTATS_MIB_FRAGFAILS twice in ip6_fragment() · afce615a
    Stefano Brivio 提交于
    RFC 2465 defines ipv6IfStatsOutFragFails as:
    
    	"The number of IPv6 datagrams that have been discarded
    	 because they needed to be fragmented at this output
    	 interface but could not be."
    
    The existing implementation, instead, would increase the counter
    twice in case we fail to allocate room for single fragments:
    once for the fragment, once for the datagram.
    
    This didn't look intentional though. In one of the two affected
    affected failure paths, the double increase was simply a result
    of a new 'goto fail' statement, introduced to avoid a skb leak.
    The other path appears to be affected since at least 2.6.12-rc2.
    Reported-by: NSabrina Dubroca <sdubroca@redhat.com>
    Fixes: 1d325d21 ("ipv6: ip6_fragment: fix headroom tests and skb leak")
    Signed-off-by: NStefano Brivio <sbrivio@redhat.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    afce615a
ip6_output.c 46.0 KB