From: "Álvaro Neira Ayuso" <alvaroneay@gmail.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [libnetfilter_queue PATCH v2] utils: add the parameter queue number in nfqnl_test
Date: Fri, 06 Jun 2014 12:54:40 +0200 [thread overview]
Message-ID: <53919DF0.4080805@gmail.com> (raw)
In-Reply-To: <20140606104458.GA3517@localhost>
El 06/06/14 12:44, Pablo Neira Ayuso escribió:
> On Fri, Jun 06, 2014 at 12:20:05PM +0200, Alvaro Neira Ayuso wrote:
>> From: Álvaro Neira Ayuso <alvaroneay@gmail.com>
>>
>> This patch allows to stablish the number of the queue that
>> we want to read the packets.
>>
>> Signed-off-by: Alvaro Neira Ayuso <alvaroneay@gmail.com>
>> ---
>> [changes in v2]
>> * I have changed the variable queue to unsigned
>> * I have changed the message in case that queue > 65535 and also I have used
>> exit(EXIT_FAILURE) in error case.
>>
>> utils/nfqnl_test.c | 13 +++++++++++--
>> 1 file changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/utils/nfqnl_test.c b/utils/nfqnl_test.c
>> index 4decd50..557db1d 100644
>> --- a/utils/nfqnl_test.c
>> +++ b/utils/nfqnl_test.c
>> @@ -85,8 +85,17 @@ int main(int argc, char **argv)
>> struct nfq_q_handle *qh;
>> int fd;
>> int rv;
>> + uint32_t queue = 0;
>> char buf[4096] __attribute__ ((aligned));
>>
>> + if (argc == 2) {
>> + queue = atoi(argv[1]);
>> + if (queue > 65535) {
>> + fprintf(stderr, "Usage: %s [<0-65535>]\n", argv[1]);
> ^^^^^^^
>
> You did *not* test the error path, this is argv[0].
>
Sure, sorry. I have understood wrong.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-06-06 10:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-06 9:58 [libnetfilter_queue PATCH 2/2] utils: add the parameter queue number in nfqnl_test Alvaro Neira Ayuso
2014-06-06 10:03 ` Pablo Neira Ayuso
2014-06-06 10:20 ` [libnetfilter_queue PATCH v2] " Alvaro Neira Ayuso
2014-06-06 10:44 ` Pablo Neira Ayuso
2014-06-06 10:54 ` Álvaro Neira Ayuso [this message]
2014-06-09 8:52 ` [libnetfilter_queue PATCH 2/2 v3] " Alvaro Neira Ayuso
2014-06-09 10:12 ` Florian Westphal
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=53919DF0.4080805@gmail.com \
--to=alvaroneay@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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 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).