From: Patrick McHardy <kaber@trash.net>
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH] parser: fix ether keyword clash
Date: Fri, 11 Apr 2014 15:51:11 +0200 [thread overview]
Message-ID: <1397224271-4507-1-git-send-email-kaber@trash.net> (raw)
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 | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/parser.y b/src/parser.y
index af34857..de5c0ed 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; }
--
1.9.0
reply other threads:[~2014-04-11 13:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1397224271-4507-1-git-send-email-kaber@trash.net \
--to=kaber@trash.net \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/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).