From e3434672b7ad38cfd58006d4361966e61b508f5e Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Mon, 7 Sep 2026 07:58:43 +0000 Subject: [PATCH] sit: implement ipip6_get_iflink() SIT currently uses ip_tunnel_get_iflink() which reads tunnel->parms.link. In order to decouple SIT parameter handling from ip_tunnel, implement its own ndo_get_iflink callback. Signed-off-by: Eric Dumazet Acked-by: Lorenzo Bianconi Link: https://patch.msgid.link/20260907075846.2913645-7-edumazet@google.com Signed-off-by: Jakub Kicinski --- net/ipv6/sit.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 7cabcd3afbc4..35c669590901 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -1444,12 +1444,19 @@ ipip6_tunnel_siocdevprivate(struct net_device *dev, struct ifreq *ifr, } } +static int ipip6_get_iflink(const struct net_device *dev) +{ + struct ip_tunnel *tunnel = netdev_priv(dev); + + return READ_ONCE(tunnel->parms.link); +} + static const struct net_device_ops ipip6_netdev_ops = { .ndo_init = ipip6_tunnel_init, .ndo_uninit = ipip6_tunnel_uninit, .ndo_start_xmit = sit_tunnel_xmit, .ndo_siocdevprivate = ipip6_tunnel_siocdevprivate, - .ndo_get_iflink = ip_tunnel_get_iflink, + .ndo_get_iflink = ipip6_get_iflink, .ndo_tunnel_ctl = ipip6_tunnel_ctl, };