aboutsummaryrefslogtreecommitdiff
path: root/gencode.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-02-02 21:48:45 -0800
committerGuy Harris <gharris@sonic.net>2021-02-02 21:48:59 -0800
commitcf4263cabfffd1e185d76dbff5d1180321cfb22c (patch)
treea41a416c97a8786f7c73c02d0d6cb7e97b62f0c5 /gencode.c
parenta6c4141ab3a3e0b47984a82b989a337fd98a8198 (diff)
Expand a comment. [skip ci]
Diffstat (limited to 'gencode.c')
-rw-r--r--gencode.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gencode.c b/gencode.c
index 29788598..b8e5bf82 100644
--- a/gencode.c
+++ b/gencode.c
@@ -6080,7 +6080,18 @@ gen_protochain(compiler_state_t *cstate, bpf_u_int32 v, int proto)
if (cstate->off_linkpl.is_variable)
bpf_error(cstate, "'protochain' not supported with variable length headers");
- cstate->no_optimize = 1; /* this code is not compatible with optimizer yet */
+ /*
+ * To quote a comment in optimize.c:
+ *
+ * "These data structures are used in a Cocke and Shwarz style
+ * value numbering scheme. Since the flowgraph is acyclic,
+ * exit values can be propagated from a node's predecessors
+ * provided it is uniquely defined."
+ *
+ * "Acyclic" means "no backward branches", which means "no
+ * loops", so we have to turn the optimizer off.
+ */
+ cstate->no_optimize = 1;
/*
* s[0] is a dummy entry to protect other BPF insn from damage