mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 20:51:44 +00:00
netfilter: nft_inner: set tunnel offset to GRE header offset
Set inner tunnel offset to the GRE header, this is redundant to existing transport header offset, but this normalizes the handling of the tunnel header regardless its location in the layering. GRE version 0 is overloaded with RFCs, the type decorator in the inner expression might also be useful to interpret matching fields from the netlink delinearize path in userspace. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
0db14b9566
commit
91619eb60a
@ -174,8 +174,13 @@ static int nft_inner_parse_tunhdr(const struct nft_inner *priv,
|
||||
const struct nft_pktinfo *pkt,
|
||||
struct nft_inner_tun_ctx *ctx, u32 *off)
|
||||
{
|
||||
if (pkt->tprot != IPPROTO_UDP ||
|
||||
pkt->tprot != IPPROTO_GRE)
|
||||
if (pkt->tprot == IPPROTO_GRE) {
|
||||
ctx->inner_tunoff = pkt->thoff;
|
||||
ctx->flags |= NFT_PAYLOAD_CTX_INNER_TUN;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (pkt->tprot != IPPROTO_UDP)
|
||||
return -1;
|
||||
|
||||
ctx->inner_tunoff = *off;
|
||||
|
Loading…
Reference in New Issue
Block a user