diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-08-15 03:00:09 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 17:54:42 -0400 |
commit | a18135eb9389c26d36ef5c05bd8bc526e0cbe883 (patch) | |
tree | 7e5c18ab898e9bd7871ce7f4944d808954a1e000 /net/ipv6 | |
parent | 81aa646cc4df3779bcbf9d18cc2c0813ee9b3262 (diff) |
[IPV6]: Add UDP_MIB_{SND,RCV}BUFERRORS handling.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/udp.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 780b89f6dfcc..c813381020bc 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -345,6 +345,8 @@ out: | |||
345 | 345 | ||
346 | static inline int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb) | 346 | static inline int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb) |
347 | { | 347 | { |
348 | int rc; | ||
349 | |||
348 | if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) { | 350 | if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) { |
349 | kfree_skb(skb); | 351 | kfree_skb(skb); |
350 | return -1; | 352 | return -1; |
@@ -356,7 +358,10 @@ static inline int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb) | |||
356 | return 0; | 358 | return 0; |
357 | } | 359 | } |
358 | 360 | ||
359 | if (sock_queue_rcv_skb(sk,skb)<0) { | 361 | if ((rc = sock_queue_rcv_skb(sk,skb)) < 0) { |
362 | /* Note that an ENOMEM error is charged twice */ | ||
363 | if (rc == -ENOMEM) | ||
364 | UDP_INC_STATS_BH(UDP_MIB_RCVBUFERRORS); | ||
360 | UDP6_INC_STATS_BH(UDP_MIB_INERRORS); | 365 | UDP6_INC_STATS_BH(UDP_MIB_INERRORS); |
361 | kfree_skb(skb); | 366 | kfree_skb(skb); |
362 | return 0; | 367 | return 0; |
@@ -857,6 +862,16 @@ out: | |||
857 | UDP6_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS); | 862 | UDP6_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS); |
858 | return len; | 863 | return len; |
859 | } | 864 | } |
865 | /* | ||
866 | * ENOBUFS = no kernel mem, SOCK_NOSPACE = no sndbuf space. Reporting | ||
867 | * ENOBUFS might not be good (it's not tunable per se), but otherwise | ||
868 | * we don't have a good statistic (IpOutDiscards but it can be too many | ||
869 | * things). We could add another new stat but at least for now that | ||
870 | * seems like overkill. | ||
871 | */ | ||
872 | if (err == -ENOBUFS || test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) { | ||
873 | UDP_INC_STATS_USER(UDP_MIB_SNDBUFERRORS); | ||
874 | } | ||
860 | return err; | 875 | return err; |
861 | 876 | ||
862 | do_confirm: | 877 | do_confirm: |