path: root/src/payload.c
diff options
authorManuel Messner <>2017-02-07 03:14:11 +0100
committerFlorian Westphal <>2017-02-12 15:34:47 +0100
commit9574c263569f477114d7885ebcf5af8af6411582 (patch)
tree42d1d91d4e40470f60021b97aaaeffc2a61ae934 /src/payload.c
parenta0cecb3ea474ad24adefcc388267684f2fddd69d (diff)
exthdr: prepare exthdr_gen_dependency for tcp support
currently exthdr always needs ipv6 dependency (i.e. link layer), but with upcomming TCP option matching we also need to include TCP at the network layer. This patch prepares this change by adding two parameters to exthdr_gen_dependency. Signed-off-by: Manuel Messner <> Signed-off-by: Florian Westphal <>
Diffstat (limited to 'src/payload.c')
1 files changed, 5 insertions, 4 deletions
diff --git a/src/payload.c b/src/payload.c
index 74f8254a..efd19602 100644
--- a/src/payload.c
+++ b/src/payload.c
@@ -317,18 +317,19 @@ int payload_gen_dependency(struct eval_ctx *ctx, const struct expr *expr,
int exthdr_gen_dependency(struct eval_ctx *ctx, const struct expr *expr,
- struct stmt **res)
+ const struct proto_desc *dependency,
+ enum proto_bases pb, struct stmt **res)
const struct proto_desc *desc;
- desc = ctx->pctx.protocol[PROTO_BASE_LL_HDR].desc;
+ desc = ctx->pctx.protocol[pb].desc;
if (desc == NULL)
return expr_error(ctx->msgs, expr,
"Cannot generate dependency: "
"no %s protocol specified",
- proto_base_names[PROTO_BASE_LL_HDR]);
+ proto_base_names[pb]);
- return payload_add_dependency(ctx, desc, &proto_ip6, expr, res);
+ return payload_add_dependency(ctx, desc, dependency, expr, res);