All of lore.kernel.org
 help / color / mirror / Atom feed
* What is 'dynamic' set flag supposed to mean?
@ 2019-09-18 11:53 Florian Westphal
  2019-09-18 14:10 ` Laura Garcia
  0 siblings, 1 reply; 14+ messages in thread
From: Florian Westphal @ 2019-09-18 11:53 UTC (permalink / raw)
  To: netfilter-devel

Hi.

Following example loads fine:
table ip NAT {
  set set1 {
    type ipv4_addr
    size 64
    flags dynamic,timeout
    timeout 1m
  }

  chain PREROUTING {
     type nat hook prerouting priority -101; policy accept;
  }
}

But adding/using this set doesn't work:
nft -- add rule NAT PREROUTING tcp dport 80 ip saddr @set1 counter
Error: Could not process rule: Operation not supported

This is because the 'dynamic' flag sets NFT_SET_EVAL.

According to kernel comment, that flag means:
 * @NFT_SET_EVAL: set can be updated from the evaluation path

The rule add is rejected from the lookup expression (nft_lookup_init)
which has:

if (set->flags & NFT_SET_EVAL)
    return -EOPNOTSUPP;

From looking at the git history, the NFT_SET_EVAL flag means that the
set contains expressions (i.e., a meter).

And I can see why doing a lookup on meters isn't meaningful.

Can someone please explain the exact precise meaning of 'dynamic'?
Was it supposed to mean 'set can be updated from packet path'?
Or was it supposed to mean 'set contains expressions'?

If its the latter, do we need a new NFT_SET flag to convey 'set
needs to support updates from packet path'?

Thanks.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-09-19 14:55 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-18 11:53 What is 'dynamic' set flag supposed to mean? Florian Westphal
2019-09-18 14:10 ` Laura Garcia
2019-09-18 14:42   ` Florian Westphal
2019-09-19  8:43     ` Pablo Neira Ayuso
2019-09-19  9:24       ` Florian Westphal
2019-09-19  9:40         ` Pablo Neira Ayuso
2019-09-19 10:03           ` Florian Westphal
2019-09-19 11:52             ` Pablo Neira Ayuso
2019-09-19 11:56             ` Florian Westphal
2019-09-19 13:28               ` Pablo Neira Ayuso
2019-09-19 14:01                 ` Florian Westphal
2019-09-19 14:22                   ` Pablo Neira Ayuso
2019-09-19 14:34                     ` Florian Westphal
2019-09-19 14:55                       ` Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.