]> git.ipfire.org Git - thirdparty/nftables.git/commit
src: add payload_dependency_exists()
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 14 Feb 2018 15:26:50 +0000 (16:26 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 15 Feb 2018 15:29:32 +0000 (16:29 +0100)
commit477a2d86c54ee8e1a8426838439e9960f892ac29
treee1b176707b5bb5c82ce50474c5db292ec52c7d89
parenta5112cc040f81806ab76d5fa0a34a2cc34da9b84
src: add payload_dependency_exists()

This helper function tells us if there is already a protocol key payload
expression, ie. those with EXPR_F_PROTOCOL flag set on, that we might
want to remove since we can infer from another expression in the upper
protocol base, eg.

ip protocol tcp tcp dport 22

'ip protocol tcp' can be removed in the ip family since it is redundant,
but not in the netdev, bridge and inet families, where we cannot make
assumptions on the layer 3 protocol.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/payload.h
src/netlink_delinearize.c
src/payload.c