summaryrefslogtreecommitdiffstats
path: root/src/payload.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2014-01-08 13:02:16 +0000
committerPatrick McHardy <kaber@trash.net>2014-01-08 13:03:19 +0000
commit87787ee86ec95a8a5494615268a03a756f48433f (patch)
treee650af949a46f09b94f404c02bd9e5db8e9dc48d /src/payload.c
parent4180fba3821d13f06fde2d662d7000e99d140693 (diff)
meta: add l4proto support
Add support for the meta l4proto type. This is used in the inet table to match on the transport layer protocol without requiring the network layer protocol to be known, allowing to use transport header matches that apply to both IPv4 and IPv6. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src/payload.c')
-rw-r--r--src/payload.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/payload.c b/src/payload.c
index ac441d4e..a312e079 100644
--- a/src/payload.c
+++ b/src/payload.c
@@ -174,6 +174,12 @@ int payload_gen_dependency(struct eval_ctx *ctx, const struct expr *expr,
}
desc = ctx->pctx.protocol[expr->payload.base - 1].desc;
+ /* Special case for mixed IPv4/IPv6 tables: use meta L4 proto */
+ if (desc == NULL &&
+ ctx->pctx.family == NFPROTO_INET &&
+ expr->payload.base == PROTO_BASE_TRANSPORT_HDR)
+ desc = &proto_inet_service;
+
if (desc == NULL)
return expr_error(ctx, expr,
"ambiguous payload specification: "