netfilter: nft_payload: support for inner header matching / mangling
Subsystems (2)
Pablo Neira Ayuso
maintainerPATCH 1/1 netfilter: nft_payload: support for inner header matching / mangling
Allow to match and mangle on inner headers from the transport payload offset. There is a new field in the pktinfo structure that stores this offset which is calculated only when requested.
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- include/net/netfilter/nf_tables.h | 4 +- include/uapi/linux/netfilter/nf_tables.h | 2 + net/netfilter/nft_payload.c | 48 +++++++++++++++++++++++- 3 files changed, 52 insertions(+), 2 deletions(-)
include/net/netfilter/nf_tables.h +3 -1
@@ -24,10 +24,12 @@ struct module;struct nft_pktinfo {struct sk_buff *skb;const struct nf_hook_state *state; -bool tprot_set; +u8 tprot_set:1 , + inner_set:1 ;u8 tprot;u16 fragoff;unsigned int thoff; +unsigned int inneroff; };static inline struct sock *nft_sk (const struct nft_pktinfo *pkt)
include/uapi/linux/netfilter/nf_tables.h +2 -0
@@ -753,11 +753,13 @@ enum nft_dynset_attributes {* @NFT_PAYLOAD_LL_HEADER: link layer header * @NFT_PAYLOAD_NETWORK_HEADER: network header * @NFT_PAYLOAD_TRANSPORT_HEADER: transport header +* @NFT_PAYLOAD_INNER_HEADER: inner header / payload */ enum nft_payload_bases {NFT_PAYLOAD_LL_HEADER ,NFT_PAYLOAD_NETWORK_HEADER ,NFT_PAYLOAD_TRANSPORT_HEADER , +NFT_PAYLOAD_INNER_HEADER , };/**
net/netfilter/nft_payload.c +47 -1
84 lines not on this page · raw message
Signature · 1 line
2.30.2