Included bogon crashes, after fix: empty_geneve_definition_crash:2:9-16: Error: Could not process rule: Invalid argument Since this feature is undocumented (hint, hint) I don't know if there are cases where ip daddr can be elided. If not, a followup patch should reject empty dst upfront so users get a more verbose error message. Signed-off-by: Florian Westphal --- src/evaluate.c | 9 +++++---- .../testcases/bogons/nft-f/empty_geneve_definition_crash | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 tests/shell/testcases/bogons/nft-f/empty_geneve_definition_crash diff --git a/src/evaluate.c b/src/evaluate.c index 0c7d90f8f43b..ac482c83cce2 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -5865,11 +5865,12 @@ static int tunnel_evaluate(struct eval_ctx *ctx, struct obj *obj) obj->tunnel.dst->dtype->size); if (expr_evaluate(ctx, &obj->tunnel.dst) < 0) return -1; - } - if (obj->tunnel.src->dtype != obj->tunnel.dst->dtype) - return __stmt_binary_error(ctx, &obj->location, NULL, - "specify either ip or ip6 for address"); + if (obj->tunnel.src && + obj->tunnel.src->dtype != obj->tunnel.dst->dtype) + return __stmt_binary_error(ctx, &obj->location, NULL, + "specify either ip or ip6 for address"); + } return 0; } diff --git a/tests/shell/testcases/bogons/nft-f/empty_geneve_definition_crash b/tests/shell/testcases/bogons/nft-f/empty_geneve_definition_crash new file mode 100644 index 000000000000..d1bc76c56bd5 --- /dev/null +++ b/tests/shell/testcases/bogons/nft-f/empty_geneve_definition_crash @@ -0,0 +1,4 @@ +table netdev x { + tunnel geneve-t { + } +} -- 2.51.0