gtp: support for IPv4-in-IPv6-GTP and IPv6-in-IPv4-GTP
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 6 May 2024 23:13:46 +0000 (01:13 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 6 May 2024 23:36:01 +0000 (01:36 +0200)
commite30ea48b5e7ebc09c4277a478727d195ca231cef
tree01985929cf7ca77cb3be3b734b16a9d54b648916
parent045a7c15e7910bcce379386390c0353c944e386a
gtp: support for IPv4-in-IPv6-GTP and IPv6-in-IPv4-GTP

Add new protocol field to PDP context that determines the transmit path
IP protocol to encapsulate the original packets, either IPv4 or IPv6.

Relax existing netlink attribute checks to allow to specify different
family in MS and peer attributes from the control plane.

Use build helpers to tx path to encapsulate IPv4-in-IPv6-GTP and
IPv6-in-IPv4-GTP according to the user-specified configuration.

From rx path, snoop for the inner protocol header since outer
skb->protocol might differ and use this to validate for valid PDP
context and to restore skb->protocol after decapsulation.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
drivers/net/gtp.c