From 5807299ed17700b838b99c93e644346c5e055914 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 31 Aug 2019 16:12:52 -0700 Subject: Just point to the big "kludge" comment in gen_vlan(). The existing comment was one that was a copy of that comment, partially but not completely changed to speak of PPPoE rather than VLAN encapsulation. [skip ci] --- gencode.c | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'gencode.c') diff --git a/gencode.c b/gencode.c index b4f2cc38..7cb211c6 100644 --- a/gencode.c +++ b/gencode.c @@ -9127,29 +9127,8 @@ gen_pppoes(compiler_state_t *cstate, bpf_u_int32 sess_num, int has_sess_num) * the PPP packet, and note that this is PPPoE rather than * raw PPP. * - * XXX - this is a bit of a kludge. If we were to split the - * compiler into a parser that parses an expression and - * generates an expression tree, and a code generator that - * takes an expression tree (which could come from our - * parser or from some other parser) and generates BPF code, - * we could perhaps make the offsets parameters of routines - * and, in the handler for an "AND" node, pass to subnodes - * other than the PPPoE node the adjusted offsets. - * - * This would mean that "pppoes" would, instead of changing the - * behavior of *all* tests after it, change only the behavior - * of tests ANDed with it. That would change the documented - * semantics of "pppoes", which might break some expressions. - * However, it would mean that "(pppoes and ip) or ip" would check - * both for VLAN-encapsulated IP and IP-over-Ethernet, rather than - * checking only for VLAN-encapsulated IP, so that could still - * be considered worth doing; it wouldn't break expressions - * that are of the form "pppoes and ..." which I suspect are the - * most common expressions involving "pppoes". "pppoes or ..." - * doesn't necessarily do what the user would really want, now, - * as all the "or ..." tests would be done assuming PPPoE, even - * though the "or" could be viewed as meaning "or, if this isn't - * a PPPoE packet...". + * XXX - this is a bit of a kludge. See the comments in + * gen_vlan(). * * The "network-layer" protocol is PPPoE, which has a 6-byte * PPPoE header, followed by a PPP packet. -- cgit v1.2.3