diff options
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 2722db024a0b..3159d16441d0 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1131,6 +1131,8 @@ static unsigned int first_packet_length(struct sock *sk) | |||
1131 | spin_lock_bh(&rcvq->lock); | 1131 | spin_lock_bh(&rcvq->lock); |
1132 | while ((skb = skb_peek(rcvq)) != NULL && | 1132 | while ((skb = skb_peek(rcvq)) != NULL && |
1133 | udp_lib_checksum_complete(skb)) { | 1133 | udp_lib_checksum_complete(skb)) { |
1134 | UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_CSUMERRORS, | ||
1135 | IS_UDPLITE(sk)); | ||
1134 | UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, | 1136 | UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, |
1135 | IS_UDPLITE(sk)); | 1137 | IS_UDPLITE(sk)); |
1136 | atomic_inc(&sk->sk_drops); | 1138 | atomic_inc(&sk->sk_drops); |
@@ -1286,8 +1288,10 @@ out: | |||
1286 | 1288 | ||
1287 | csum_copy_err: | 1289 | csum_copy_err: |
1288 | slow = lock_sock_fast(sk); | 1290 | slow = lock_sock_fast(sk); |
1289 | if (!skb_kill_datagram(sk, skb, flags)) | 1291 | if (!skb_kill_datagram(sk, skb, flags)) { |
1292 | UDP_INC_STATS_USER(sock_net(sk), UDP_MIB_CSUMERRORS, is_udplite); | ||
1290 | UDP_INC_STATS_USER(sock_net(sk), UDP_MIB_INERRORS, is_udplite); | 1293 | UDP_INC_STATS_USER(sock_net(sk), UDP_MIB_INERRORS, is_udplite); |
1294 | } | ||
1291 | unlock_sock_fast(sk, slow); | 1295 | unlock_sock_fast(sk, slow); |
1292 | 1296 | ||
1293 | if (noblock) | 1297 | if (noblock) |
@@ -1513,7 +1517,7 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
1513 | 1517 | ||
1514 | if (rcu_access_pointer(sk->sk_filter) && | 1518 | if (rcu_access_pointer(sk->sk_filter) && |
1515 | udp_lib_checksum_complete(skb)) | 1519 | udp_lib_checksum_complete(skb)) |
1516 | goto drop; | 1520 | goto csum_error; |
1517 | 1521 | ||
1518 | 1522 | ||
1519 | if (sk_rcvqueues_full(sk, skb, sk->sk_rcvbuf)) | 1523 | if (sk_rcvqueues_full(sk, skb, sk->sk_rcvbuf)) |
@@ -1533,6 +1537,8 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
1533 | 1537 | ||
1534 | return rc; | 1538 | return rc; |
1535 | 1539 | ||
1540 | csum_error: | ||
1541 | UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_CSUMERRORS, is_udplite); | ||
1536 | drop: | 1542 | drop: |
1537 | UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite); | 1543 | UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite); |
1538 | atomic_inc(&sk->sk_drops); | 1544 | atomic_inc(&sk->sk_drops); |
@@ -1749,6 +1755,7 @@ csum_error: | |||
1749 | proto == IPPROTO_UDPLITE ? "Lite" : "", | 1755 | proto == IPPROTO_UDPLITE ? "Lite" : "", |
1750 | &saddr, ntohs(uh->source), &daddr, ntohs(uh->dest), | 1756 | &saddr, ntohs(uh->source), &daddr, ntohs(uh->dest), |
1751 | ulen); | 1757 | ulen); |
1758 | UDP_INC_STATS_BH(net, UDP_MIB_CSUMERRORS, proto == IPPROTO_UDPLITE); | ||
1752 | drop: | 1759 | drop: |
1753 | UDP_INC_STATS_BH(net, UDP_MIB_INERRORS, proto == IPPROTO_UDPLITE); | 1760 | UDP_INC_STATS_BH(net, UDP_MIB_INERRORS, proto == IPPROTO_UDPLITE); |
1754 | kfree_skb(skb); | 1761 | kfree_skb(skb); |