aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/udp.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-10-14 20:12:40 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-18 21:52:54 -0400
commit8edf19c2fe028563fc6ea9cb1995b8ee4172d4b6 (patch)
tree55c423bc7e13e99e816d95886f7d340dc1163ffa /net/ipv4/udp.c
parentc720c7e8383aff1cb219bddf474ed89d850336e3 (diff)
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>
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r--net/ipv4/udp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index ec5c7a720c0c..4274c1cc78fd 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -867,6 +867,7 @@ static unsigned int first_packet_length(struct sock *sk)
867 udp_lib_checksum_complete(skb)) { 867 udp_lib_checksum_complete(skb)) {
868 UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, 868 UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS,
869 IS_UDPLITE(sk)); 869 IS_UDPLITE(sk));
870 atomic_inc(&sk->sk_drops);
870 __skb_unlink(skb, rcvq); 871 __skb_unlink(skb, rcvq);
871 __skb_queue_tail(&list_kill, skb); 872 __skb_queue_tail(&list_kill, skb);
872 } 873 }
@@ -1186,6 +1187,7 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
1186 1187
1187drop: 1188drop:
1188 UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite); 1189 UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite);
1190 atomic_inc(&sk->sk_drops);
1189 kfree_skb(skb); 1191 kfree_skb(skb);
1190 return -1; 1192 return -1;
1191} 1193}