netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nfnetlink_acct v2 1/2] nfnl_acct_new: add packet/byte values check
@ 2013-04-14  9:53 Michael Zintakis
  0 siblings, 0 replies; only message in thread
From: Michael Zintakis @ 2013-04-14  9:53 UTC (permalink / raw)
  To: netfilter-devel; +Cc: pablo

* check that in nfnetlink_acct.c::nfnl_acct_new both packet and byte
  values are specified and return EINVAL if that is not the case

Signed-off-by: Michael Zintakis <michael.zintakis@googlemail.com>
---
 net/netfilter/nfnetlink_acct.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nfnetlink_acct.c b/net/netfilter/nfnetlink_acct.c
index dc3fd5d..c8d1282 100644
--- a/net/netfilter/nfnetlink_acct.c
+++ b/net/netfilter/nfnetlink_acct.c
@@ -45,7 +45,9 @@ nfnl_acct_new(struct sock *nfnl, struct sk_buff *skb,
 	struct nf_acct *nfacct, *matching = NULL;
 	char *acct_name;
 
-	if (!tb[NFACCT_NAME])
+	if (!tb[NFACCT_NAME] ||
+	    (tb[NFACCT_BYTES] && !tb[NFACCT_PKTS]) ||
+	    (!tb[NFACCT_BYTES] && tb[NFACCT_PKTS]))
 		return -EINVAL;
 
 	acct_name = nla_data(tb[NFACCT_NAME]);


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-04-14  9:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-14  9:53 [PATCH nfnetlink_acct v2 1/2] nfnl_acct_new: add packet/byte values check Michael Zintakis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).