summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2024-05-07 01:12:36 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2024-05-07 01:35:58 +0200
commite4f88f7381fa551ff4ad059930a729a0ef2b405f (patch)
treede97ead9be712fa36c7c8a11b092fce6d6d5627d
parentc6461ec97b256856e6736454f00af70d9d12f171 (diff)
downloadlinux-e4f88f7381fa551ff4ad059930a729a0ef2b405f.tar.gz
linux-e4f88f7381fa551ff4ad059930a729a0ef2b405f.tar.bz2
linux-e4f88f7381fa551ff4ad059930a729a0ef2b405f.zip
gtp: pass up link local traffic to userspace socket
According to TS 29.061, it is possible to see IPv6 link-local traffic in the GTP tunnel, see 11.2.1.3.2 IPv6 Stateless Address Autoconfiguration (IPv6 SLAAC). Pass up these packets to the userspace daemon to handle them as control GTP traffic. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--drivers/net/gtp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
index 8e861778c4e9..939699d6cf6f 100644
--- a/drivers/net/gtp.c
+++ b/drivers/net/gtp.c
@@ -251,6 +251,10 @@ static bool gtp_check_ms_ipv6(struct sk_buff *skb, struct pdp_ctx *pctx,
ip6h = (struct ipv6hdr *)(skb->data + hdrlen);
+ if ((ipv6_addr_type(&ip6h->saddr) & IPV6_ADDR_LINKLOCAL) ||
+ (ipv6_addr_type(&ip6h->daddr) & IPV6_ADDR_LINKLOCAL))
+ return false;
+
if (role == GTP_ROLE_SGSN) {
ret = ipv6_pdp_addr_equal(&ip6h->daddr, &pctx->ms.addr6);
} else {