]> git.ipfire.org Git - thirdparty/nftables.git/commit
src: convert set to list expression
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 8 Jul 2025 22:32:13 +0000 (00:32 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 9 Jul 2025 22:13:04 +0000 (00:13 +0200)
commit01fdd7c7f445337c460738aa872cbdaabb5316ea
tree947ca13cedc90e3bf0346987a37f3d94d40df854
parent2022e8bb5cf0e0fa81ab0a5087bd1ab6e20280ee
src: convert set to list expression

The following definition:

 define xyz = { "dummy0", "dummy1" }

is represented as a set expression to ease integration with sets.

However, this definition can be used in chains and flowtables to specify
the devices, for instance:

  table netdev x {
    chain y {
      type filter hook ingress devices = $xyz priority 0; policy drop;
    }
  }

in this context, $xyz defines a _list_ of devices, not a set.

Transform the set to list expression from the evaluation step for chains
and flowtables.

This patch also handles:

 define xyz = { "dummy0", $abc }

where $abc is also transformed to a list expression in the context of
chains and flowtables.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c
src/mnl.c