All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH nft] parser_bison: allow to use mark as datatype for maps and sets
  2015-06-16 15:52 [PATCH nft] parser_bison: allow to use mark as datatype for maps and sets Pablo Neira Ayuso
@ 2015-06-16 15:49 ` Patrick McHardy
  2015-06-16 15:57   ` Pablo Neira Ayuso
  0 siblings, 1 reply; 5+ messages in thread
From: Patrick McHardy @ 2015-06-16 15:49 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel, exa.exa

On 16.06, Pablo Neira Ayuso wrote:
> Update the grammar to accept a MARK token as datatype.
> 
> Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1012
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> ---
> @Patrick: I think you prefer this update rather than renaming this to
> packetmark. This comes in response to this patch proposal:
> http://patchwork.ozlabs.org/patch/485058/

Yes, I think this is preferrable since the mark type can be used for
things besides packet marking, f.i. conntracks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH nft] parser_bison: allow to use mark as datatype for maps and sets
@ 2015-06-16 15:52 Pablo Neira Ayuso
  2015-06-16 15:49 ` Patrick McHardy
  0 siblings, 1 reply; 5+ messages in thread
From: Pablo Neira Ayuso @ 2015-06-16 15:52 UTC (permalink / raw)
  To: netfilter-devel; +Cc: kaber, exa.exa

Update the grammar to accept a MARK token as datatype.

Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1012
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
@Patrick: I think you prefer this update rather than renaming this to
packetmark. This comes in response to this patch proposal:
http://patchwork.ozlabs.org/patch/485058/

 src/parser_bison.y |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/parser_bison.y b/src/parser_bison.y
index 89874e9..6f47745 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -398,12 +398,12 @@ static void location_update(struct location *loc, struct location *rhs, int n)
 %token XML			"xml"
 %token JSON			"json"
 
-%type <string>			identifier string comment_spec
-%destructor { xfree($$); }	identifier string comment_spec
+%type <string>			identifier type_identifier string comment_spec
+%destructor { xfree($$); }	identifier type_identifier string comment_spec
 
 %type <val>			time_spec
 
-%type <val>			type_identifier
+%type <val>			type_identifier_list
 %type <datatype>		data_type
 
 %type <cmd>			line
@@ -1028,7 +1028,7 @@ set_policy_spec		:	PERFORMANCE	{ $$ = NFT_SET_POL_PERFORMANCE; }
 			|	MEMORY		{ $$ = NFT_SET_POL_MEMORY; }
 			;
 
-data_type		:	type_identifier
+data_type		:	type_identifier_list
 			{
 				if ($1 & ~TYPE_MASK)
 					$$ = concat_type_alloc($1);
@@ -1037,7 +1037,7 @@ data_type		:	type_identifier
 			}
 			;
 
-type_identifier		:	identifier
+type_identifier_list	:	type_identifier
 			{
 				const struct datatype *dtype = datatype_lookup_byname($1);
 				if (dtype == NULL) {
@@ -1047,7 +1047,7 @@ type_identifier		:	identifier
 				}
 				$$ = dtype->type;
 			}
-			|	type_identifier	DOT		identifier
+			|	type_identifier_list	DOT	type_identifier
 			{
 				const struct datatype *dtype = datatype_lookup_byname($3);
 				if (dtype == NULL) {
@@ -1059,6 +1059,10 @@ type_identifier		:	identifier
 			}
 			;
 
+type_identifier		:	STRING	{ $$ = $1; }
+			|	MARK	{ $$ = xstrdup("mark"); }
+			;
+
 hook_spec		:	TYPE		STRING		HOOK		STRING		PRIORITY	NUM
 			{
 				$<chain>0->type		= chain_type_name_lookup($2);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH nft] parser_bison: allow to use mark as datatype for maps and sets
  2015-06-16 15:49 ` Patrick McHardy
@ 2015-06-16 15:57   ` Pablo Neira Ayuso
  2015-06-17  8:29     ` Miroslav Kratochvil
  0 siblings, 1 reply; 5+ messages in thread
From: Pablo Neira Ayuso @ 2015-06-16 15:57 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: netfilter-devel, exa.exa

On Tue, Jun 16, 2015 at 05:49:24PM +0200, Patrick McHardy wrote:
> On 16.06, Pablo Neira Ayuso wrote:
> > Update the grammar to accept a MARK token as datatype.
> > 
> > Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1012
> > Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> > ---
> > @Patrick: I think you prefer this update rather than renaming this to
> > packetmark. This comes in response to this patch proposal:
> > http://patchwork.ozlabs.org/patch/485058/
> 
> Yes, I think this is preferrable since the mark type can be used for
> things besides packet marking, f.i. conntracks.

Ok, then I'll push this patch, thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH nft] parser_bison: allow to use mark as datatype for maps and sets
  2015-06-16 15:57   ` Pablo Neira Ayuso
@ 2015-06-17  8:29     ` Miroslav Kratochvil
  2015-06-17 10:33       ` Pablo Neira Ayuso
  0 siblings, 1 reply; 5+ messages in thread
From: Miroslav Kratochvil @ 2015-06-17  8:29 UTC (permalink / raw)
  To: Pablo Neira Ayuso, Patrick McHardy; +Cc: netfilter-devel

> > Yes, I think this is preferrable since the mark type can be used for
> > things besides packet marking, f.i. conntracks.
>
> Ok, then I'll push this patch, thanks!


Great, marking by named map is now perfectly usuable.

One last (cosmetic reminder) thing, could the last occurence of
"packetmark" type name in documentation also be replaced with "mark",
for consistency?

in doc/nft.xml, lines 988, 1887.

Many thanks to you both.
-mk

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH nft] parser_bison: allow to use mark as datatype for maps and sets
  2015-06-17  8:29     ` Miroslav Kratochvil
@ 2015-06-17 10:33       ` Pablo Neira Ayuso
  0 siblings, 0 replies; 5+ messages in thread
From: Pablo Neira Ayuso @ 2015-06-17 10:33 UTC (permalink / raw)
  To: Miroslav Kratochvil; +Cc: Patrick McHardy, netfilter-devel

On Wed, Jun 17, 2015 at 10:29:30AM +0200, Miroslav Kratochvil wrote:
> > > Yes, I think this is preferrable since the mark type can be used for
> > > things besides packet marking, f.i. conntracks.
> >
> > Ok, then I'll push this patch, thanks!
> 
> 
> Great, marking by named map is now perfectly usuable.
> 
> One last (cosmetic reminder) thing, could the last occurence of
> "packetmark" type name in documentation also be replaced with "mark",
> for consistency?
> 
> in doc/nft.xml, lines 988, 1887.

Would you send us a Signed-off-by patch that I can apply via git am?

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-06-17 10:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-16 15:52 [PATCH nft] parser_bison: allow to use mark as datatype for maps and sets Pablo Neira Ayuso
2015-06-16 15:49 ` Patrick McHardy
2015-06-16 15:57   ` Pablo Neira Ayuso
2015-06-17  8:29     ` Miroslav Kratochvil
2015-06-17 10:33       ` Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.