summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-04-11 14:52:01 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-04-11 14:56:51 +0200
commit2bce4249a8e90c67a24e096f91047795f92ab548 (patch)
treecd98fd491c3d7ddd5b76a1203c73163c0c4b3947
parent9cebb41568453f544bdfc3ccc6c5d12de34a4c7f (diff)
trafgen: parser: fix regression on last pkt element
Jon Schipp reported that a arbitrary packet config such as ... { "MyPacket", "MyPacket", "MyPacket", "MyPacket", "MyPacket", "MyPacket", "MyPacket", "MyPacket", } ... doesn't work anymore, although it used to work. This regression was introduced by commit f9591eebe40c ("trafgen: lexer/parser: fix cpu() selection and whitespacing"). Reported-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
-rw-r--r--trafgen_parser.y9
1 files changed, 7 insertions, 2 deletions
diff --git a/trafgen_parser.y b/trafgen_parser.y
index 16701c7..8b8f3e6 100644
--- a/trafgen_parser.y
+++ b/trafgen_parser.y
@@ -349,9 +349,15 @@ cpu_delim
| '-' { }
;
+delimiter_nowhite
+ : ',' { }
+ | ',' K_WHITE { }
+ ;
+
noenforce_white
: { }
| K_WHITE { }
+ | delimiter_nowhite { }
;
packet
@@ -384,9 +390,8 @@ payload
;
delimiter
- : ',' { }
+ : delimiter_nowhite { }
| K_WHITE { }
- | ',' K_WHITE { }
;
elem_delimiter