net: sk_drops consolidation part 2
- skb_kill_datagram() can increment sk->sk_drops itself, not callers. - UDP on IPV4 & IPV6 dropped frames (because of bad checksum or policy checks) increment sk_drops Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
c720c7e838
commit
8edf19c2fe
@@ -517,7 +517,6 @@ csum_copy_err:
|
||||
as some normal condition.
|
||||
*/
|
||||
err = (flags&MSG_DONTWAIT) ? -EAGAIN : -EHOSTUNREACH;
|
||||
atomic_inc(&sk->sk_drops);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@@ -390,11 +390,13 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
|
||||
if (rc == -ENOMEM)
|
||||
UDP6_INC_STATS_BH(sock_net(sk),
|
||||
UDP_MIB_RCVBUFERRORS, is_udplite);
|
||||
goto drop;
|
||||
goto drop_no_sk_drops_inc;
|
||||
}
|
||||
|
||||
return 0;
|
||||
drop:
|
||||
atomic_inc(&sk->sk_drops);
|
||||
drop_no_sk_drops_inc:
|
||||
UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite);
|
||||
kfree_skb(skb);
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user