summaryrefslogtreecommitdiffstats
path: root/src/parser.y
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2014-04-11 15:50:15 +0200
committerPatrick McHardy <kaber@trash.net>2014-04-11 15:50:15 +0200
commit45be073de9fc162f63b69e6fbec3474156bb363c (patch)
treea4abe271da43e80d88d97d5ee5409f8a3d13f285 /src/parser.y
parent21966fa7e242c58c2d581c406af4e7978c981465 (diff)
parser: fix ether keyword clash
Due to the renaming of the "eth" keyword to "ether", parsing of arphrd type "ether" fails. Fix similar to TCP, UDP etc by allocating a constant arphrd expression for the ether keyword without a following key. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src/parser.y')
-rw-r--r--src/parser.y7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/parser.y b/src/parser.y
index af348578..de5c0edf 100644
--- a/src/parser.y
+++ b/src/parser.y
@@ -1639,6 +1639,13 @@ eth_hdr_expr : ETHER eth_hdr_field
{
$$ = payload_expr_alloc(&@$, &proto_eth, $2);
}
+ | ETHER
+ {
+ uint16_t data = ARPHRD_ETHER;
+ $$ = constant_expr_alloc(&@$, &arphrd_type,
+ BYTEORDER_BIG_ENDIAN,
+ sizeof(data) * BITS_PER_BYTE, &data);
+ }
;
eth_hdr_field : SADDR { $$ = ETHHDR_SADDR; }