]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
parser: remove 'reset' as reserve keyword
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 7 Mar 2016 12:17:24 +0000 (13:17 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 7 Mar 2016 12:32:25 +0000 (13:32 +0100)
The 'reset' keyword can be used as dccp type, so don't qualify it as
reserve keyword to avoid a conflict with this.

Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1055
Reported-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/parser_bison.y
src/scanner.l

index d41fc0ab8dcaadb30025a2e019c1fbcb49ac80d5..3f2263994d124d2dc63e83d6efeda4e50cfcbba8 100644 (file)
@@ -380,7 +380,6 @@ static void location_update(struct location *loc, struct location *rhs, int n)
 %token WEEK                    "week"
 
 %token _REJECT                 "reject"
-%token RESET                   "reset"
 %token WITH                    "with"
 %token ICMPX                   "icmpx"
 
@@ -1573,9 +1572,15 @@ reject_opts              :       /* empty */
                                                          $4);
                                $<stmt>0->reject.expr->dtype = &icmpx_code_type;
                        }
-                       |       WITH    TCP     RESET
+                       |       WITH    TCP     STRING
                        {
-                               $<stmt>0->reject.type = NFT_REJECT_TCP_RST;
+                               if (strcmp($3, "reset") == 0) {
+                                       $<stmt>0->reject.type = NFT_REJECT_TCP_RST;
+                               } else {
+                                       erec_queue(error(&@2, "unsupported reject type", $3),
+                                                  state->msgs);
+                                       YYERROR;
+                               }
                        }
                        ;
 
index a0dee47500538e1a4b1f110f7fd952e0c9406562..60b61a5a17b8289925124864b8c7512df60a473c 100644 (file)
@@ -326,7 +326,6 @@ addrstring  ({macaddr}|{ip4addr}|{ip6addr})
 
 "reject"               { return _REJECT; }
 "with"                 { return WITH; }
-"reset"                        { return RESET; }
 "icmpx"                        { return ICMPX; }
 
 "snat"                 { return SNAT; }