diff options
author | Denis Ovsienko <denis@ovsienko.info> | 2022-06-14 20:35:41 +0100 |
---|---|---|
committer | Denis Ovsienko <denis@ovsienko.info> | 2022-06-14 21:35:54 +0100 |
commit | e6129d599345f9fc9bd2352fda902322d7c24b82 (patch) | |
tree | 8f55d44fa2ad7ceee6a5d1e41eaee845e0f26eb7 /gencode.c | |
parent | 0d5a888d19214661c472302ba31ad0b7c4dc22af (diff) |
Remove the unused CHASE_CHAIN props.
CHASE_CHAIN is not correlated with the build process, it has been
undefined since it was introduced in commit 7fe3c11 in 1999, possibly as
a leftover from earlier prototypes. If defined, the code still compiles
fine, but quietly changes the behaviour in meaningful ways, which is a
wrong thing to do. Remove the macro and the associated dead code.
A practical side effect of this change is that gen_protochain() now can
be conditional solely on NO_PROTOCHAIN, which simplifies getting the
latter right to solve the build problem stated in GH #852.
Diffstat (limited to 'gencode.c')
-rw-r--r-- | gencode.c | 11 |
1 files changed, 0 insertions, 11 deletions
@@ -1,4 +1,3 @@ -/*#define CHASE_CHAIN*/ /* * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998 * The Regents of the University of California. All rights reserved. @@ -6412,9 +6411,7 @@ static struct block * gen_proto(compiler_state_t *cstate, bpf_u_int32 v, int proto, int dir) { struct block *b0, *b1; -#ifndef CHASE_CHAIN struct block *b2; -#endif if (dir != Q_DEFAULT) bpf_error(cstate, "direction applied to 'proto'"); @@ -6446,11 +6443,7 @@ gen_proto(compiler_state_t *cstate, bpf_u_int32 v, int proto, int dir) * So we always check for ETHERTYPE_IP. */ b0 = gen_linktype(cstate, ETHERTYPE_IP); -#ifndef CHASE_CHAIN b1 = gen_cmp(cstate, OR_LINKPL, 9, BPF_B, v); -#else - b1 = gen_protochain(cstate, v, Q_IP); -#endif gen_and(b0, b1); return b1; @@ -6512,7 +6505,6 @@ gen_proto(compiler_state_t *cstate, bpf_u_int32 v, int proto, int dir) case Q_IPV6: b0 = gen_linktype(cstate, ETHERTYPE_IPV6); -#ifndef CHASE_CHAIN /* * Also check for a fragment header before the final * header. @@ -6522,9 +6514,6 @@ gen_proto(compiler_state_t *cstate, bpf_u_int32 v, int proto, int dir) gen_and(b2, b1); b2 = gen_cmp(cstate, OR_LINKPL, 6, BPF_B, v); gen_or(b2, b1); -#else - b1 = gen_protochain(cstate, v, Q_IPV6); -#endif gen_and(b0, b1); return b1; |