netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: shivanib134@gmail.com
Subject: [PATCH 1/2 nft] parser: remove 'reset' as reserve keyword
Date: Mon,  7 Mar 2016 13:37:47 +0100	[thread overview]
Message-ID: <1457354268-11240-1-git-send-email-pablo@netfilter.org> (raw)

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 | 11 ++++++++---
 src/scanner.l      |  1 -
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/parser_bison.y b/src/parser_bison.y
index d41fc0a..3f22639 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -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;
+				}
 			}
 			;
 
diff --git a/src/scanner.l b/src/scanner.l
index a0dee47..60b61a5 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -326,7 +326,6 @@ addrstring	({macaddr}|{ip4addr}|{ip6addr})
 
 "reject"		{ return _REJECT; }
 "with"			{ return WITH; }
-"reset"			{ return RESET; }
 "icmpx"			{ return ICMPX; }
 
 "snat"			{ return SNAT; }
-- 
2.1.4


             reply	other threads:[~2016-03-07 12:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-07 12:37 Pablo Neira Ayuso [this message]
2016-03-07 12:37 ` [PATCH 2/2 nft] tests/py: enable tests for dccp types Pablo Neira Ayuso

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=1457354268-11240-1-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=shivanib134@gmail.com \
    /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).