]> git.ipfire.org Git - thirdparty/nftables.git/commit
evaluate: bogus missing transport protocol
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 4 Apr 2023 13:30:20 +0000 (15:30 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 5 Apr 2023 13:57:17 +0000 (15:57 +0200)
commit2c227f00f0df9552b786080a8fd27c6a360e5828
tree425dfb781fd94cea1678045f8cfcd8f7b6ef5647
parent17a39cb0b082fe5117801d0b1a41407eec7b776c
evaluate: bogus missing transport protocol

Users have to specify a transport protocol match such as

meta l4proto tcp

before the redirect statement, even if the redirect statement already
implicitly refers to the transport protocol, for instance:

test.nft:3:16-53: Error: transport protocol mapping is only valid after transport protocol match
                redirect to :tcp dport map { 83 : 8083, 84 : 8084 }
                ~~~~~~~~     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Evaluate the redirect expression before the mandatory check for the
transport protocol match, so protocol context already provides a
transport protocol.

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