gtp: add IPv6 support
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 6 May 2024 23:12:08 +0000 (01:12 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 6 May 2024 23:35:57 +0000 (01:35 +0200)
commit999cb275c807b92662f8a74fdaee9619700f64a5
tree4bb8c846752d92a5ca980edcf5d6e80aa95c3535
parent750771d0ca76817e15fef1211b9748ae7ed3aff6
gtp: add IPv6 support

Add new iflink attributes to configure in-kernel UDP listener socket
address: IFLA_GTP_LOCAL and IFLA_GTP_LOCAL6. If none of these attributes
are specified, default is still to IPv4 INADDR_ANY for backward
compatibility.

Add new attributes to set up family and IPv6 address of GTP tunnels:
GTPA_FAMILY, GTPA_PEER_ADDR6 and GTPA_MS_ADDR6. If no GTPA_FAMILY is
specified, AF_INET is assumed for backward compatibility.

setsockopt IPV6_ADDRFORM allows to downgrade socket from IPv6 to IPv4
after socket is bound. Assumption is that socket listener that is
attached to the gtp device needs to be either IPv4 or IPv6. Therefore,
GTP socket listener does not allow for IPv4-mapped-IPv6 listener.

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