fib: Change data type of fib oifname to "ifname"
PATCH 1/1 fib: Change data type of fib oifname to "ifname"
Change data type of fib oifname from "string" to "ifname", so that it can be matched against a set of ifnames:
set x {
type ifname
}
chain y {
fib saddr oifname @x drop
}Signed-off-by Xiao Liang <[email protected]>
--- doc/primary-expression.txt | 4 ++-- src/fib.c | 2 +- tests/shell/testcases/sets/0029named_ifname_dtype_0 | 1 + tests/shell/testcases/sets/dumps/0029named_ifname_dtype_0.nft | 1 + 4 files changed, 5 insertions(+), 3 deletions(-)
doc/primary-expression.txt +2 -2
@@ -354,10 +354,10 @@ address types can be shown with *nft* *describe* *fib_addrtype*. |Keyword| Description| Result Type |oif| Output interface index| -integer (32 bit) +iface_index |oifname| Output interface name| -string +ifname |type| Address type | fib_addrtype (see *nft* *describe* *fib_addrtype* for a list)
src/fib.c +1 -1
@@ -179,7 +179,7 @@ struct expr *fib_expr_alloc(const struct location *loc, type = &ifindex_type;break ;case NFT_FIB_RESULT_OIFNAME : - type = &string_type; + type = &ifname_type; len =IFNAMSIZ *BITS_PER_BYTE ;break ;case NFT_FIB_RESULT_ADDRTYPE :
tests/shell/testcases/sets/0029named_ifname_dtype_0 +1 -0
@@ -40,6 +40,7 @@ EXPECTED="table inet t { chain c { iifname @s accept oifname @s accept + fib saddr oifname @s accept tcp dport . meta iifname @sc accept meta iifname . meta mark @nv accept }
tests/shell/testcases/sets/dumps/0029named_ifname_dtype_0.nft +1 -0
@@ -51,6 +51,7 @@ table inet t { chain c { iifname @s accept oifname @s accept + fib saddr oifname @s accept tcp dport . iifname @sc accept iifname . meta mark @nv accept }
Signature · 1 line
2.48.1
Quoted 9 lines · Xiao Liang
Change data type of fib oifname from "string" to "ifname", so that it can be matched against a set of ifnames:
set x { type ifname } chain y { fib saddr oifname @x drop }
Applied, thanks!