]> git.ipfire.org Git - thirdparty/nftables.git/commit
parser: reject zero-length interface names
authorFlorian Westphal <fw@strlen.de>
Mon, 19 Jun 2023 20:43:04 +0000 (22:43 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 20 Jun 2023 19:46:13 +0000 (21:46 +0200)
commitfa52bc22580632b4b78c263e338ddfbe235a8218
tree92d543d323267f59ec2246d4e2d8b1cc1b6776d2
parentbb16416ec82599e41043a52887c37157e6f61984
parser: reject zero-length interface names

device "" results in an assertion during evaluation.
Before:
nft: expression.c:426: constant_expr_alloc: Assertion `(((len) + (8) - 1) / (8)) > 0' failed.
After:
zero_length_devicename_assert:3:42-49: Error: you cannot set an empty interface name
type filter hook ingress device""lo" priority -1
                         ^^^^^^^^
Signed-off-by: Florian Westphal <fw@strlen.de>
src/parser_bison.y
tests/shell/testcases/bogons/nft-f/zero_length_devicename_assert [new file with mode: 0644]