]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
parser: fix ether keyword clash
authorPatrick McHardy <kaber@trash.net>
Fri, 11 Apr 2014 13:50:15 +0000 (15:50 +0200)
committerPatrick McHardy <kaber@trash.net>
Fri, 11 Apr 2014 13:50:15 +0000 (15:50 +0200)
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>
src/parser.y

index af348578298ebc5c9f8ece6b0886dd60698b1320..de5c0edf50450ec0affc20c1f222b057d85371ab 100644 (file)
@@ -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; }