Skip to contentSkip to conversation

RFC: Ideas about possible solutions for nfbz#949

DISCUSSION Phil Sutter 2 participants 5 messages May 10, 2017 – Jun 23, 2017 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

Hi,

Netfilter Bugzilla #949[1] complains about broken output when trying to match icmpv6 message fields. This is a problem in how payload match is implemented in nft: The given match (e.g. 'icmp6 id 2') is broken down to a simple match of header data at a specific offset. Sadly this does not work with ICMP(v6) since header structure depends on the packet's ICMP type and on return path there is no information about which type of message the user wanted to match against.

My idea was to build something like the protocol dependencies we have for e.g. TCP header fields but with ICMP, a given header field might be present in multiple message types (e.g. icmp6_id is present in echo request as well as reply).

I already considered inserting a match for icmp6 type against an anonymous set (like 'icmp6 type { echo-request, echo-reply }'), but having this as an implicit dependency and resolving with previous matches, etc. becomes pretty complex.

Do you think I should try following a different approach (via userdata e.g.)?

Thanks, Phil

[1] https://bugzilla.netfilter.org/show_bug.cgi?id=949

#1 lore raw

Hi Phil,

I'm recovering this RFC that got lost in the pile.

Quoted 9 lines · Phil Sutter

Hi,

Netfilter Bugzilla #949[1] complains about broken output when trying to match icmpv6 message fields. This is a problem in how payload match is implemented in nft: The given match (e.g. 'icmp6 id 2') is broken down to a simple match of header data at a specific offset. Sadly this does not work with ICMP(v6) since header structure depends on the packet's ICMP type and on return path there is no information about which type of message the user wanted to match against.

Right, this is a longstanding bug.

Quoted 4 lines

My idea was to build something like the protocol dependencies we have for e.g. TCP header fields but with ICMP, a given header field might be present in multiple message types (e.g. icmp6_id is present in echo request as well as reply).

You mean adding more instructions when generating bytecode? This has runtime overhead, just to provide context for just listing the ruleset. I would prefer we skip this.

Quoted 7 lines

I already considered inserting a match for icmp6 type against an anonymous set (like 'icmp6 type { echo-request, echo-reply }'), but having this as an implicit dependency and resolving with previous matches, etc. becomes pretty complex.

Do you think I should try following a different approach (via userdata e.g.)?

I think you should try adding some context structure to the expr_print(), this context can be used to interpret this offset based on the icmp type.

Someone (Elise?) send me a patch to add this context structure, just to prepare introduction, but she got stuck in the context update logic at some point. I can find such patch so you only have to figure out how to annotate the information we need in this context structure.

author reviewer
#2 lore raw

Hi Pablo,

Quoted 1 line · Pablo Neira Ayuso

I'm recovering this RFC that got lost in the pile.

Thanks for not dropping it! :)

Quoted 13 lines · Phil Sutter
Quoted 9 lines

Hi,

Netfilter Bugzilla #949[1] complains about broken output when trying to match icmpv6 message fields. This is a problem in how payload match is implemented in nft: The given match (e.g. 'icmp6 id 2') is broken down to a simple match of header data at a specific offset. Sadly this does not work with ICMP(v6) since header structure depends on the packet's ICMP type and on return path there is no information about which type of message the user wanted to match against.

Right, this is a longstanding bug.

Quoted 8 lines
Quoted 4 lines

My idea was to build something like the protocol dependencies we have for e.g. TCP header fields but with ICMP, a given header field might be present in multiple message types (e.g. icmp6_id is present in echo request as well as reply).

You mean adding more instructions when generating bytecode? This has runtime overhead, just to provide context for just listing the ruleset. I would prefer we skip this.

Yes, that is questionable. But it is a matter of definition in my PoV. A user saying 'icmp6 id 2' might not be aware that all possible icmp6 packets might match, not only those making use of the ID field. Right now it feels like we want a low-level 'icmp6 offset X mask y' and a high-level 'icmp6 echo direction any id 2' but that's probably out of scope here.

Quoted 8 lines
Quoted 7 lines

I already considered inserting a match for icmp6 type against an anonymous set (like 'icmp6 type { echo-request, echo-reply }'), but having this as an implicit dependency and resolving with previous matches, etc. becomes pretty complex.

Do you think I should try following a different approach (via userdata e.g.)?

Quoted 8 lines

I think you should try adding some context structure to the expr_print(), this context can be used to interpret this offset based on the icmp type.

Someone (Elise?) send me a patch to add this context structure, just to prepare introduction, but she got stuck in the context update logic at some point. I can find such patch so you only have to figure out how to annotate the information we need in this context structure.

Yes, that would be great. Having something to get me started is always very helpful. :)

Thanks, Phil

#3 lore raw

On Tue, May 30, 2017 at 01:04:24PM +0200, Phil Sutter wrote:
[...]

Quoted 1 line · Pablo Neira Ayuso

[...]

Quoted 9 lines
Quoted 8 lines
Quoted 4 lines

My idea was to build something like the protocol dependencies we have for e.g. TCP header fields but with ICMP, a given header field might be present in multiple message types (e.g. icmp6_id is present in echo request as well as reply).

You mean adding more instructions when generating bytecode? This has runtime overhead, just to provide context for just listing the ruleset. I would prefer we skip this.

Quoted 6 lines

Yes, that is questionable. But it is a matter of definition in my PoV. A user saying 'icmp6 id 2' might not be aware that all possible icmp6 packets might match, not only those making use of the ID field. Right now it feels like we want a low-level 'icmp6 offset X mask y' and a high-level 'icmp6 echo direction any id 2' but that's probably out of scope here.

If the user just specifies 'icmp6 id 2', we should reject this and ask for a specific icmp type.

Quoted 12 lines
Quoted 12 lines
Quoted 7 lines

I already considered inserting a match for icmp6 type against an anonymous set (like 'icmp6 type { echo-request, echo-reply }'), but having this as an implicit dependency and resolving with previous matches, etc. becomes pretty complex.

Do you think I should try following a different approach (via userdata e.g.)?

I think you should try adding some context structure to the expr_print(), this context can be used to interpret this offset based on the icmp type.

Quoted 7 lines
Quoted 4 lines

Someone (Elise?) send me a patch to add this context structure, just to prepare introduction, but she got stuck in the context update logic at some point. I can find such patch so you only have to figure out how to annotate the information we need in this context structure.

Yes, that would be great. Having something to get me started is always very helpful. :)

I'm attaching what Elise sent me for review.

This is just an initial patch to add some context structure for expr_print(), so it's pretty much the simple initial step.

Not telling here you have to use 'struct proto_ctx' specifically, I guess we need some print_ctx structure for this to annotate that we have seen "icmp type" already, so offset interpretation is based on

I would need to spend more time here to provide a more specific design for this, so if you can come back with initial ideas, that would be good.

Quoted 1 line

From b4531696ec0c2c9407c9a7655f9cb133280294ff Mon Sep 17 00:00:00 2001

From: Elise Lennion <[email protected]>
Date: Tue, 17 Jan 2017 21:53:15 -0200
Subject: [PATCH] First part of icmp print patch.

---
 include/expression.h |  5 ++--
 src/ct.c             |  5 ++--
 src/evaluate.c       |  2 +-
 src/expression.c     | 70 +++++++++++++++++++++++++++++++---------------------
 src/exthdr.c         |  3 ++-
 src/fib.c            |  3 ++-
 src/hash.c           |  5 ++--
 src/meta.c           |  5 ++--
 src/netlink.c        |  6 ++---
 src/numgen.c         |  3 ++-
 src/payload.c        |  7 +++---
 src/rt.c             |  3 ++-
 src/rule.c           |  2 +-
 src/segtree.c        |  2 +-
 src/statement.c      | 40 +++++++++++++++---------------
 15 files changed, 92 insertions(+), 69 deletions(-)
include/expression.h +3 -2
index ec90265..8010f34 100644
@@ -157,7 +157,8 @@ struct expr_ops {
 	void			(*set_type)(const struct expr *expr,
 					    const struct datatype *dtype,
 					    enum byteorder byteorder);
-	void			(*print)(const struct expr *expr);
+	void			(*print)(const struct expr *expr,
+					 const struct proto_ctx *ctx);
 	bool			(*cmp)(const struct expr *e1,
 				       const struct expr *e2);
 	void			(*pctx_update)(struct proto_ctx *ctx,
@@ -324,7 +325,7 @@ extern struct expr *expr_alloc(const struct location *loc,
 extern struct expr *expr_clone(const struct expr *expr);
 extern struct expr *expr_get(struct expr *expr);
 extern void expr_free(struct expr *expr);
-extern void expr_print(const struct expr *expr);
+extern void expr_print(const struct expr *expr, const struct proto_ctx *ctx);
 extern bool expr_cmp(const struct expr *e1, const struct expr *e2);
 extern void expr_describe(const struct expr *expr);
 
src/ct.c +3 -2
index 31c7a4b..20bbeea 100644
@@ -236,7 +236,8 @@ static const struct ct_template ct_templates[] = {
 					      BYTEORDER_HOST_ENDIAN, 64),
 };
 
-static void ct_expr_print(const struct expr *expr)
+static void ct_expr_print(const struct expr *expr,
+			  const struct proto_ctx *ctx)
 {
 	const struct symbolic_constant *s;
 
@@ -398,7 +399,7 @@ void ct_expr_update_type(struct proto_ctx *ctx, struct expr *expr)
 static void ct_stmt_print(const struct stmt *stmt)
 {
 	printf("ct %s set ", ct_templates[stmt->ct.key].token);
-	expr_print(stmt->ct.expr);
+	expr_print(stmt->ct.expr, NULL);
 }
 
 static const struct stmt_ops ct_stmt_ops = {
src/evaluate.c +1 -1
index bcbced1..d0f2421 100644
@@ -1622,7 +1622,7 @@ static int expr_evaluate(struct eval_ctx *ctx, struct expr **expr)
 		struct error_record *erec;
 		erec = erec_create(EREC_INFORMATIONAL, &(*expr)->location,
 				   "Evaluate %s", (*expr)->ops->name);
-		erec_print(stdout, erec); expr_print(*expr); printf("\n\n");
+		erec_print(stdout, erec); expr_print(*expr, NULL); printf("\n\n");
 	}
 #endif
 
src/expression.c +42 -28

193 lines not on this page · raw message

src/exthdr.c +2 -1
index c641d4a..a5fb58b 100644
@@ -22,7 +22,8 @@
 #include <headers.h>
 #include <expression.h>
 
-static void exthdr_expr_print(const struct expr *expr)
+static void exthdr_expr_print(const struct expr *expr,
+			      const struct proto_ctx *ctx)
 {
 	printf("%s %s", expr->exthdr.desc->name, expr->exthdr.tmpl->token);
 }
src/fib.c +2 -1
index c65677c..aafeec0 100644
@@ -71,7 +71,8 @@ static void __fib_expr_print_f(unsigned int *flags, unsigned int f, const char *
 		printf(" . ");
 }
 
-static void fib_expr_print(const struct expr *expr)
+static void fib_expr_print(const struct expr *expr,
+			   const struct proto_ctx *ctx)
 {
 	unsigned int flags = expr->fib.flags;
 
src/hash.c +3 -2
index d26b2ed..61b2ae0 100644
@@ -15,10 +15,11 @@
 #include <hash.h>
 #include <utils.h>
 
-static void hash_expr_print(const struct expr *expr)
+static void hash_expr_print(const struct expr *expr,
+		            const struct proto_ctx *ctx)
 {
 	printf("jhash ");
-	expr_print(expr->hash.expr);
+	expr_print(expr->hash.expr, NULL);
 	printf(" mod %u", expr->hash.mod);
 	if (expr->hash.seed)
 		printf(" seed 0x%x", expr->hash.seed);
src/meta.c +3 -2
index cb7c136..00284cf 100644
@@ -464,7 +464,8 @@ static bool meta_key_is_qualified(enum nft_meta_keys key)
 	}
 }
 
-static void meta_expr_print(const struct expr *expr)
+static void meta_expr_print(const struct expr *expr,
+		            const struct proto_ctx *ctx)
 {
 	if (meta_key_is_qualified(expr->meta.key))
 		printf("meta %s", meta_templates[expr->meta.key].token);
@@ -591,7 +592,7 @@ static void meta_stmt_print(const struct stmt *stmt)
 	else
 		printf("%s set ", meta_templates[stmt->meta.key].token);
 
-	expr_print(stmt->meta.expr);
+	expr_print(stmt->meta.expr, NULL);
 }
 
 static const struct stmt_ops meta_stmt_ops = {
src/netlink.c +3 -3
index 4135f25..439dd2f 100644
@@ -2184,7 +2184,7 @@ static int netlink_events_setelem_cb(const struct nlmsghdr *nlh, int type,
 			goto out;
 		}
 		printf("element %s %s %s ", family2str(family), table, setname);
-		expr_print(dummyset->init);
+		expr_print(dummyset->init, NULL);
 		printf("\n");
 
 		set_free(dummyset);
@@ -2546,7 +2546,7 @@ static void trace_print_expr(const struct nftnl_trace *nlt, unsigned int attr,
 				   len * BITS_PER_BYTE, data);
 	rel  = relational_expr_alloc(&netlink_location, OP_EQ, lhs, rhs);
 
-	expr_print(rel);
+	expr_print(rel, NULL);
 	printf(" ");
 	expr_free(rel);
 }
@@ -2563,7 +2563,7 @@ static void trace_print_verdict(const struct nftnl_trace *nlt)
 	expr = verdict_expr_alloc(&netlink_location, verdict, chain);
 
 	printf("verdict ");
-	expr_print(expr);
+	expr_print(expr, NULL);
 	expr_free(expr);
 }
 
src/numgen.c +2 -1
index 5c1d00a..9f17cdc 100644
@@ -28,7 +28,8 @@ static const char *numgen_type_str(enum nft_ng_types type)
 	return numgen_type[type];
 }
 
-static void numgen_expr_print(const struct expr *expr)
+static void numgen_expr_print(const struct expr *expr,
+		              const struct proto_ctx *ctx)
 {
 	printf("numgen %s mod %u", numgen_type_str(expr->numgen.type),
 	       expr->numgen.mod);
src/payload.c +4 -3
index af533b2..a0f0816 100644
@@ -38,7 +38,8 @@ bool payload_is_known(const struct expr *expr)
 	       tmpl != &proto_unknown_template;
 }
 
-static void payload_expr_print(const struct expr *expr)
+static void payload_expr_print(const struct expr *expr,
+		               const struct proto_ctx *ctx)
 {
 	const struct proto_desc *desc;
 	const struct proto_hdr_template *tmpl;
@@ -164,9 +165,9 @@ unsigned int payload_hdr_field(const struct expr *expr)
 
 static void payload_stmt_print(const struct stmt *stmt)
 {
-	expr_print(stmt->payload.expr);
+	expr_print(stmt->payload.expr, NULL);
 	printf(" set ");
-	expr_print(stmt->payload.val);
+	expr_print(stmt->payload.val, NULL);
 }
 
 static const struct stmt_ops payload_stmt_ops = {
src/rt.c +2 -1
index 232c1dc..455eac0 100644
@@ -75,7 +75,8 @@ static const struct rt_template rt_templates[] = {
 					      true),
 };
 
-static void rt_expr_print(const struct expr *expr)
+static void rt_expr_print(const struct expr *expr,
+			  const struct proto_ctx *ctx)
 {
 	printf("rt %s", rt_templates[expr->rt.key].token);
 }
src/rule.c +1 -1
index f2ffd4b..327988a 100644
@@ -351,7 +351,7 @@ static void do_set_print(const struct set *set, struct print_fmt_options *opts)
 
 	if (set->init != NULL && set->init->size > 0) {
 		printf("%s%selements = ", opts->tab, opts->tab);
-		expr_print(set->init);
+		expr_print(set->init, NULL);
 		printf("%s", opts->nl);
 	}
 	printf("%s}%s", opts->tab, opts->nl);
src/segtree.c +1 -1
index 8df82a8..456a9ea 100644
@@ -563,7 +563,7 @@ int set_to_intervals(struct list_head *errs, struct set *set,
 	}
 
 	if (segtree_debug()) {
-		expr_print(init);
+		expr_print(init, NULL);
 		pr_gmp_debug("\n");
 	}
 	return 0;
src/statement.c +20 -20
index 25bed65..7e2e448 100644
@@ -67,7 +67,7 @@ void stmt_print(const struct stmt *stmt)
 
 static void expr_stmt_print(const struct stmt *stmt)
 {
-	expr_print(stmt->expr);
+	expr_print(stmt->expr, NULL);
 }
 
 static void expr_stmt_destroy(struct stmt *stmt)
@@ -111,11 +111,11 @@ static void flow_stmt_print(const struct stmt *stmt)
 {
 	printf("flow ");
 	if (stmt->flow.set) {
-		expr_print(stmt->flow.set);
+		expr_print(stmt->flow.set, NULL);
 		printf(" ");
 	}
 	printf("{ ");
-	expr_print(stmt->flow.key);
+	expr_print(stmt->flow.key, NULL);
 	printf(" ");
 	stmt_print(stmt->flow.stmt);
 	printf("} ");
@@ -182,7 +182,7 @@ static const char *objref_type_name(uint32_t type)
 static void objref_stmt_print(const struct stmt *stmt)
 {
 	printf("%s name ", objref_type_name(stmt->objref.type));
-	expr_print(stmt->objref.expr);
+	expr_print(stmt->objref.expr, NULL);
 }
 
 static const struct stmt_ops objref_stmt_ops = {
@@ -364,7 +364,7 @@ static void queue_stmt_print(const struct stmt *stmt)
 	printf("queue");
 	if (stmt->queue.queue != NULL) {
 		printf(" num ");
-		expr_print(stmt->queue.queue);
+		expr_print(stmt->queue.queue, NULL);
 	}
 	if (stmt->queue.flags & NFT_QUEUE_FLAG_BYPASS) {
 		printf("%sbypass", delim);
@@ -428,7 +428,7 @@ static void reject_stmt_print(const struct stmt *stmt)
 		if (stmt->reject.icmp_code == NFT_REJECT_ICMPX_PORT_UNREACH)
 			break;
 		printf(" with icmpx type ");
-		expr_print(stmt->reject.expr);
+		expr_print(stmt->reject.expr, NULL);
 		break;
 	case NFT_REJECT_ICMP_UNREACH:
 		switch (stmt->reject.family) {
@@ -436,13 +436,13 @@ static void reject_stmt_print(const struct stmt *stmt)
 			if (stmt->reject.icmp_code == ICMP_PORT_UNREACH)
 				break;
 			printf(" with icmp type ");
-			expr_print(stmt->reject.expr);
+			expr_print(stmt->reject.expr, NULL);
 			break;
 		case NFPROTO_IPV6:
 			if (stmt->reject.icmp_code == ICMP6_DST_UNREACH_NOPORT)
 				break;
 			printf(" with icmpv6 type ");
-			expr_print(stmt->reject.expr);
+			expr_print(stmt->reject.expr, NULL);
 			break;
 		}
 		break;
@@ -494,24 +494,24 @@ static void nat_stmt_print(const struct stmt *stmt)
 			if (stmt->nat.addr->ops->type == EXPR_VALUE &&
 			    stmt->nat.addr->dtype->type == TYPE_IP6ADDR) {
 				printf("[");
-				expr_print(stmt->nat.addr);
+				expr_print(stmt->nat.addr, NULL);
 				printf("]");
 			} else if (stmt->nat.addr->ops->type == EXPR_RANGE &&
 				   stmt->nat.addr->left->dtype->type == TYPE_IP6ADDR) {
 				printf("[");
-				expr_print(stmt->nat.addr->left);
+				expr_print(stmt->nat.addr->left, NULL);
 				printf("]-[");
-				expr_print(stmt->nat.addr->right);
+				expr_print(stmt->nat.addr->right, NULL);
 				printf("]");
 			}
 		} else {
-			expr_print(stmt->nat.addr);
+			expr_print(stmt->nat.addr, NULL);
 		}
 	}
 
 	if (stmt->nat.proto) {
 		printf(":");
-		expr_print(stmt->nat.proto);
+		expr_print(stmt->nat.proto, NULL);
 	}
 
 	print_nf_nat_flags(stmt->nat.flags);
@@ -541,7 +541,7 @@ static void masq_stmt_print(const struct stmt *stmt)
 
 	if (stmt->masq.proto) {
 		printf(" to :");
-		expr_print(stmt->masq.proto);
+		expr_print(stmt->masq.proto, NULL);
 	}
 
 	print_nf_nat_flags(stmt->masq.flags);
@@ -570,7 +570,7 @@ static void redir_stmt_print(const struct stmt *stmt)
 
 	if (stmt->redir.proto) {
 		printf(" to :");
-		expr_print(stmt->redir.proto);
+		expr_print(stmt->redir.proto, NULL);
 	}
 
 	print_nf_nat_flags(stmt->redir.flags);
@@ -601,9 +601,9 @@ static const char * const set_stmt_op_names[] = {
 static void set_stmt_print(const struct stmt *stmt)
 {
 	printf("set %s ", set_stmt_op_names[stmt->set.op]);
-	expr_print(stmt->set.key);
+	expr_print(stmt->set.key, NULL);
 	printf(" ");
-	expr_print(stmt->set.set);
+	expr_print(stmt->set.set, NULL);
 }
 
 static void set_stmt_destroy(struct stmt *stmt)
@@ -629,11 +629,11 @@ static void dup_stmt_print(const struct stmt *stmt)
 	printf("dup");
 	if (stmt->dup.to != NULL) {
 		printf(" to ");
-		expr_print(stmt->dup.to);
+		expr_print(stmt->dup.to, NULL);
 
 		if (stmt->dup.dev != NULL) {
 			printf(" device ");
-			expr_print(stmt->dup.dev);
+			expr_print(stmt->dup.dev, NULL);
 		}
 	}
 }
@@ -659,7 +659,7 @@ struct stmt *dup_stmt_alloc(const struct location *loc)
 static void fwd_stmt_print(const struct stmt *stmt)
 {
 	printf("fwd to ");
-	expr_print(stmt->fwd.to);
+	expr_print(stmt->fwd.to, NULL);
 }
 
 static void fwd_stmt_destroy(struct stmt *stmt)
Signature · 1 line
2.7.4
author reviewer
#4 lore raw
Quoted 20 lines · Pablo Neira Ayuso

On Tue, May 30, 2017 at 01:04:24PM +0200, Phil Sutter wrote:
[...]

Quoted 1 line · Pablo Neira Ayuso

[...]

Quoted 9 lines
Quoted 8 lines
Quoted 4 lines

My idea was to build something like the protocol dependencies we have for e.g. TCP header fields but with ICMP, a given header field might be present in multiple message types (e.g. icmp6_id is present in echo request as well as reply).

You mean adding more instructions when generating bytecode? This has runtime overhead, just to provide context for just listing the ruleset. I would prefer we skip this.

Quoted 6 lines

Yes, that is questionable. But it is a matter of definition in my PoV. A user saying 'icmp6 id 2' might not be aware that all possible icmp6 packets might match, not only those making use of the ID field. Right now it feels like we want a low-level 'icmp6 offset X mask y' and a high-level 'icmp6 echo direction any id 2' but that's probably out of scope here.

Quoted 2 lines

If the user just specifies 'icmp6 id 2', we should reject this and ask for a specific icmp type.

If nft is supposed to check the semantics, that's not as easy since in worst case, user specified 'icmp6 type { echo-request, echo-reply }' (for a valid example) or 'icmp6 type { echo-request, nd-redirect }' (for an invalid one). Just making sure icmp6 type has been specified should be possible though (but may not be helpful later in output path).

Quoted 25 lines
Quoted 12 lines
Quoted 12 lines
Quoted 7 lines

I already considered inserting a match for icmp6 type against an anonymous set (like 'icmp6 type { echo-request, echo-reply }'), but having this as an implicit dependency and resolving with previous matches, etc. becomes pretty complex.

Do you think I should try following a different approach (via userdata e.g.)?

I think you should try adding some context structure to the expr_print(), this context can be used to interpret this offset based on the icmp type.

Quoted 7 lines
Quoted 4 lines

Someone (Elise?) send me a patch to add this context structure, just to prepare introduction, but she got stuck in the context update logic at some point. I can find such patch so you only have to figure out how to annotate the information we need in this context structure.

Yes, that would be great. Having something to get me started is always very helpful. :)

I'm attaching what Elise sent me for review.

This is just an initial patch to add some context structure for expr_print(), so it's pretty much the simple initial step.

Quoted 7 lines

Not telling here you have to use 'struct proto_ctx' specifically, I guess we need some print_ctx structure for this to annotate that we have seen "icmp type" already, so offset interpretation is based on

I would need to spend more time here to provide a more specific design for this, so if you can come back with initial ideas, that would be good.

Yes, looking at previous matches might help but I'm getting stuck when it comes to corner cases like in my examples above: 'icmp6 id' is valid for more than a single icmp6 type, and there is nothing preventing a user from giving a set of icmp6 types to match against. So this won't lead to a "what type is this field match for" kind of test but rather a "are all given types valid for that human readable representation of the field match".

Thanks, Phil