From: Florian Westphal <fw@strlen.de>
To: netfilter-devel@vger.kernel.org
Cc: Florian Westphal <fw@strlen.de>
Subject: [PATCH 1/2] NFQUEUE: use NFPROTO_UNSPEC
Date: Fri, 5 Jun 2009 03:17:58 +0200 [thread overview]
Message-ID: <1244164679-11032-2-git-send-email-fw@strlen.de> (raw)
In-Reply-To: <1244164679-11032-1-git-send-email-fw@strlen.de>
also, xtables_strtoui() does the range check for us, no need for binary "&".
Signed-off-by: Florian Westphal <fw@strlen.de>
---
extensions/libxt_NFQUEUE.c | 20 +++-----------------
1 files changed, 3 insertions(+), 17 deletions(-)
diff --git a/extensions/libxt_NFQUEUE.c b/extensions/libxt_NFQUEUE.c
index 3ca2239..6939c6f 100644
--- a/extensions/libxt_NFQUEUE.c
+++ b/extensions/libxt_NFQUEUE.c
@@ -32,12 +32,12 @@ static void
parse_num(const char *s, struct xt_NFQ_info *tinfo)
{
unsigned int num;
-
+
if (!xtables_strtoui(s, NULL, &num, 0, UINT16_MAX))
xtables_error(PARAMETER_PROBLEM,
"Invalid queue number `%s'\n", s);
- tinfo->queuenum = num & 0xffff;
+ tinfo->queuenum = num;
}
static int
@@ -78,7 +78,7 @@ static void NFQUEUE_save(const void *ip, const struct xt_entry_target *target)
}
static struct xtables_target nfqueue_target = {
- .family = NFPROTO_IPV4,
+ .family = NFPROTO_UNSPEC,
.name = "NFQUEUE",
.version = XTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_NFQ_info)),
@@ -90,21 +90,7 @@ static struct xtables_target nfqueue_target = {
.extra_opts = NFQUEUE_opts
};
-static struct xtables_target nfqueue_target6 = {
- .family = NFPROTO_IPV6,
- .name = "NFQUEUE",
- .version = XTABLES_VERSION,
- .size = XT_ALIGN(sizeof(struct xt_NFQ_info)),
- .userspacesize = XT_ALIGN(sizeof(struct xt_NFQ_info)),
- .help = NFQUEUE_help,
- .parse = NFQUEUE_parse,
- .print = NFQUEUE_print,
- .save = NFQUEUE_save,
- .extra_opts = NFQUEUE_opts,
-};
-
void _init(void)
{
xtables_register_target(&nfqueue_target);
- xtables_register_target(&nfqueue_target6);
}
--
1.6.0.6
next prev parent reply other threads:[~2009-06-05 1:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-05 1:17 NFQUEUE balancing extension (userspace changes) Florian Westphal
2009-06-05 1:17 ` Florian Westphal [this message]
2009-06-05 12:57 ` [PATCH 1/2] NFQUEUE: use NFPROTO_UNSPEC Jan Engelhardt
2009-06-05 13:23 ` Florian Westphal
2009-06-05 1:17 ` [PATCH 2/2] NFQUEUE: add new v1 version with queue-balance option Florian Westphal
2009-06-05 13:02 ` Jan Engelhardt
2009-06-05 13:27 ` Florian Westphal
2009-06-05 13:30 ` Jan Engelhardt
2009-06-05 13:33 ` Florian Westphal
2009-06-05 11:28 ` NFQUEUE balancing extension (userspace changes) Patrick McHardy
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=1244164679-11032-2-git-send-email-fw@strlen.de \
--to=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.