From 87787ee86ec95a8a5494615268a03a756f48433f Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Wed, 8 Jan 2014 13:02:16 +0000 Subject: 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 --- src/payload.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/payload.c') 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: " -- cgit v1.2.3