diff options
author | Ashish Sharma <ashishsharma@google.com> | 2011-01-31 13:08:00 -0800 |
---|---|---|
committer | Jonas ABERG <jonas.aberg@stericsson.com> | 2011-04-01 13:25:24 +0200 |
commit | b2b0e17f668a7fb4eb929d96dbfd530195e3ee3e (patch) | |
tree | f0a57fcd2b8fbaf6f82322457b6f4b0c724bd0f3 /net | |
parent | 1e7a31f5e2710df6aae73fd2fe67599d3cec3ac7 (diff) |
net: Add UDP stats and pkt count to uid_stat
Change-Id: If95374a6dbde66720a3c74b5b50cc7e774bbbbf8
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/19498
Tested-by: Piotr TOMASZEWSKI <piotr.tomaszewski@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/udp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 434dd677741..aeef230ed4b 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -100,6 +100,7 @@ #include <linux/skbuff.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> +#include <linux/uid_stat.h> #include <net/net_namespace.h> #include <net/icmp.h> #include <net/route.h> @@ -962,8 +963,10 @@ out: ip_rt_put(rt); if (free) kfree(ipc.opt); - if (!err) + if (!err) { + uid_stat_udp_snd(current_uid(), len); return len; + } /* * ENOBUFS = no kernel mem, SOCK_NOSPACE = no sndbuf space. Reporting * ENOBUFS might not be good (it's not tunable per se), but otherwise @@ -1196,6 +1199,8 @@ try_again: out_free: skb_free_datagram_locked(sk, skb); out: + if (err > 0) + uid_stat_udp_rcv(current_uid(), err); return err; csum_copy_err: |