]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxt_NFQUEUE: add mutual exclusion between qnum and qbal
authorJan Engelhardt <jengelh@medozas.de>
Tue, 24 May 2011 22:26:01 +0000 (00:26 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Tue, 24 May 2011 22:38:55 +0000 (00:38 +0200)
Only one is printed on save operation, which leads me to believe that
only one is meant to be used. The manpage seems to corroborate.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
extensions/libxt_NFQUEUE.c

index 71ead8d6d985a1fd538d37b0e2b5a737ff4c95c2..e47b586c8175900033c50dd7601be6da120c3b7f 100644 (file)
@@ -13,6 +13,8 @@ enum {
        O_QUEUE_NUM = 0,
        O_QUEUE_BALANCE,
        O_QUEUE_BYPASS,
+       F_QUEUE_NUM     = 1 << O_QUEUE_NUM,
+       F_QUEUE_BALANCE = 1 << O_QUEUE_BALANCE,
 };
 
 static void NFQUEUE_help(void)
@@ -41,9 +43,10 @@ static void NFQUEUE_help_v2(void)
 #define s struct xt_NFQ_info
 static const struct xt_option_entry NFQUEUE_opts[] = {
        {.name = "queue-num", .id = O_QUEUE_NUM, .type = XTTYPE_UINT16,
-        .flags = XTOPT_PUT, XTOPT_POINTER(s, queuenum)},
+        .flags = XTOPT_PUT, XTOPT_POINTER(s, queuenum),
+        .excl = F_QUEUE_BALANCE},
        {.name = "queue-balance", .id = O_QUEUE_BALANCE,
-        .type = XTTYPE_UINT16RC},
+        .type = XTTYPE_UINT16RC, .excl = F_QUEUE_NUM},
        {.name = "queue-bypass", .id = O_QUEUE_BYPASS, .type = XTTYPE_NONE},
        XTOPT_TABLEEND,
 };