From: Florian Westphal <fw@strlen.de>
To: Shivani Bhardwaj <shivanib134@gmail.com>
Cc: Florian Westphal <fw@strlen.de>,
Netfilter Development Mailing list
<netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH] NFQUEUE: Fix bug with order of fanout and bypass
Date: Tue, 12 Apr 2016 19:56:41 +0200 [thread overview]
Message-ID: <20160412175641.GB4311@breakpoint.cc> (raw)
In-Reply-To: <CAKHNQQEaV9-DWByD7vaxQYL5nPKjAvZyo_3YKxMGGGCLyUCkRA@mail.gmail.com>
Shivani Bhardwaj <shivanib134@gmail.com> wrote:
> > I think that this would make it a bit clearer and
> > it also avoids the v3/v2/v1 stacking.
> >
> Sure.
> Just to make sure I get this right, should I be using two objects of
> structures xt_NFQ_info_v3 and xt_NFQ_info_v2 (since v3 does not have
> bypass) and make switch cases accordingly in v3?
I meant something like this (untested):
diff --git a/extensions/libxt_NFQUEUE.c b/extensions/libxt_NFQUEUE.c
index 8115457..9750ce0 100644
--- a/extensions/libxt_NFQUEUE.c
+++ b/extensions/libxt_NFQUEUE.c
@@ -108,11 +108,14 @@ static void NFQUEUE_parse_v3(struct xt_option_call *cb)
{
struct xt_NFQ_info_v3 *info = cb->data;
- NFQUEUE_parse_v2(cb);
+ NFQUEUE_parse_v1(cb);
switch (cb->entry->id) {
case O_QUEUE_CPU_FANOUT:
info->flags |= NFQ_FLAG_CPU_FANOUT;
break;
+ case O_QUEUE_BYPASS:
+ info->flags |= NFQ_FLAG_BYPASS;
+ break;
}
}
> Should I be doing this for all the functions (save, xlate, print)
> since the same stacking is there too?
Hmm, I think it would make sense to disentangle this as well
(as a 2nd cleanup patch).
The ->bypass/->flag overloading works but its not really obvious...
I don't have a strong opinion however, if you think your v1 patch
is ok I'm fine with it as well.
prev parent reply other threads:[~2016-04-12 17:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-12 17:18 [PATCH] NFQUEUE: Fix bug with order of fanout and bypass Shivani Bhardwaj
2016-04-12 17:28 ` Florian Westphal
2016-04-12 17:35 ` Shivani Bhardwaj
2016-04-12 17:56 ` Florian Westphal [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160412175641.GB4311@breakpoint.cc \
--to=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=shivanib134@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).