Re: [libnetfilter_queue PATCH v2] utils: add the parameter queue number in nfqnl_test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>

This patch allows to stablish the number of the queue that
we want to read the packets.

Signed-off-by: Alvaro Neira Ayuso <alvaroneay@xxxxxxxxx>
---
[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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux