diff options
author | JP Abgrall <jpa@google.com> | 2013-04-08 15:09:26 -0700 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2016-03-11 15:56:55 +0100 |
commit | e41f7cdae524b549884a11c4b8a16ae6e3a73f2f (patch) | |
tree | 6e3534cebeb0f5ba6b6c63cdd49e5136449c28ba /net | |
parent | dc5a908304999415ba65883254d5b0fec4ae91a1 (diff) | |
download | kernel_samsung_espresso10-e41f7cdae524b549884a11c4b8a16ae6e3a73f2f.zip kernel_samsung_espresso10-e41f7cdae524b549884a11c4b8a16ae6e3a73f2f.tar.gz kernel_samsung_espresso10-e41f7cdae524b549884a11c4b8a16ae6e3a73f2f.tar.bz2 |
netfilter: qtaguid: rate limit some of the printks
Some of the printks are in the packet handling path.
We now ratelimit the very unlikely errors to avoid
kmsg spamming.
Signed-off-by: JP Abgrall <jpa@google.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/xt_qtaguid.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/net/netfilter/xt_qtaguid.c b/net/netfilter/xt_qtaguid.c index f6d4cfc..492ad3f 100644 --- a/net/netfilter/xt_qtaguid.c +++ b/net/netfilter/xt_qtaguid.c @@ -19,6 +19,7 @@ #include <linux/module.h> #include <linux/netfilter/x_tables.h> #include <linux/netfilter/xt_qtaguid.h> +#include <linux/ratelimit.h> #include <linux/skbuff.h> #include <linux/workqueue.h> #include <net/addrconf.h> @@ -1322,12 +1323,12 @@ static void iface_stat_update_from_skb(const struct sk_buff *skb, } if (unlikely(!el_dev)) { - pr_err("qtaguid[%d]: %s(): no par->in/out?!!\n", - par->hooknum, __func__); + pr_err_ratelimited("qtaguid[%d]: %s(): no par->in/out?!!\n", + par->hooknum, __func__); BUG(); } else if (unlikely(!el_dev->name)) { - pr_err("qtaguid[%d]: %s(): no dev->name?!!\n", - par->hooknum, __func__); + pr_err_ratelimited("qtaguid[%d]: %s(): no dev->name?!!\n", + par->hooknum, __func__); BUG(); } else { int proto = ipx_proto(skb, par); @@ -1410,8 +1411,8 @@ static void if_tag_stat_update(const char *ifname, uid_t uid, iface_entry = get_iface_entry(ifname); if (!iface_entry) { - pr_err("qtaguid: iface_stat: stat_update() %s not found\n", - ifname); + pr_err_ratelimited("qtaguid: iface_stat: stat_update() " + "%s not found\n", ifname); return; } /* It is ok to process data when an iface_entry is inactive */ |