]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: convert remaining ipv6_stub users to direct function calls
authorFernando Fernandez Mancera <fmancera@suse.de>
Wed, 25 Mar 2026 12:08:49 +0000 (13:08 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sun, 29 Mar 2026 18:21:23 +0000 (11:21 -0700)
As IPv6 is built-in only, the ipv6_stub infrastructure is no longer
necessary.

Convert remaining ipv6_stub users to make direct function calls. The
fallback functions introduced previously will prevent linkage errors
when CONFIG_IPV6 is disabled.

Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
Tested-by: Ricardo B. Marlière <rbm@suse.com>
Link: https://patch.msgid.link/20260325120928.15848-9-fmancera@suse.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/udp_tunnel.h
net/mpls/af_mpls.c
net/openvswitch/actions.c
net/sched/sch_frag.c
net/tipc/udp_media.c
net/xfrm/espintcp.c
net/xfrm/xfrm_nat_keepalive.c
net/xfrm/xfrm_output.c

index fc1fc43345b5d8503f4fb1a53deca491cea3962c..40089fc4c1bafcbc4f32fe06d774667a216bd336 100644 (file)
@@ -230,7 +230,7 @@ static inline void udp_tunnel_encap_enable(struct sock *sk)
 
 #if IS_ENABLED(CONFIG_IPV6)
        if (READ_ONCE(sk->sk_family) == PF_INET6)
-               ipv6_stub->udpv6_encap_enable();
+               udpv6_encap_enable();
 #endif
        udp_encap_enable();
 }
index b32311f5cbf75ccb114c2ddf85d463a7a582901a..58a5bd69ee617fd714934cfd7514292577e107e2 100644 (file)
@@ -24,7 +24,6 @@
 #if IS_ENABLED(CONFIG_IPV6)
 #include <net/ipv6.h>
 #endif
-#include <net/ipv6_stubs.h>
 #include <net/rtnh.h>
 #include "internal.h"
 
@@ -642,7 +641,7 @@ static struct net_device *inet6_fib_lookup_dev(struct net *net,
 
        memset(&fl6, 0, sizeof(fl6));
        memcpy(&fl6.daddr, addr, sizeof(struct in6_addr));
-       dst = ipv6_stub->ipv6_dst_lookup_flow(net, NULL, &fl6, NULL);
+       dst = ip6_dst_lookup_flow(net, NULL, &fl6, NULL);
        if (IS_ERR(dst))
                return ERR_CAST(dst);
 
index 792ca44a461da0bb98d49bfe9f233214fb57a61e..140388a18ae042164206e3cb6e81028eeea88e5c 100644 (file)
@@ -21,6 +21,7 @@
 #include <net/ip.h>
 #include <net/ipv6.h>
 #include <net/ip6_fib.h>
+#include <net/ip6_route.h>
 #include <net/checksum.h>
 #include <net/dsfield.h>
 #include <net/mpls.h>
@@ -810,7 +811,7 @@ static void ovs_fragment(struct net *net, struct vport *vport,
                skb_dst_set_noref(skb, &ovs_rt.dst);
                IP6CB(skb)->frag_max_size = mru;
 
-               ipv6_stub->ipv6_fragment(net, skb->sk, skb, ovs_vport_output);
+               ip6_fragment(net, skb->sk, skb, ovs_vport_output);
                refdst_drop(orig_dst);
        } else {
                WARN_ONCE(1, "Failed fragment ->%s: eth=%04x, MRU=%d, MTU=%d.",
index d1d87dce7f3f72e33e3c8ec0c0eb35bdd9b5c9f1..75ee527509196e3bd176cd3c37e0c41be0c2db15 100644 (file)
@@ -6,6 +6,7 @@
 #include <net/dst.h>
 #include <net/ip.h>
 #include <net/ip6_fib.h>
+#include <net/ip6_route.h>
 
 struct sch_frag_data {
        unsigned long dst;
@@ -127,8 +128,7 @@ static int sch_fragment(struct net *net, struct sk_buff *skb,
                skb_dst_set_noref(skb, &sch_frag_rt.dst);
                IP6CB(skb)->frag_max_size = mru;
 
-               ret = ipv6_stub->ipv6_fragment(net, skb->sk, skb,
-                                              sch_frag_xmit);
+               ret = ip6_fragment(net, skb->sk, skb, sch_frag_xmit);
                local_unlock_nested_bh(&sch_frag_data_storage.bh_lock);
                refdst_drop(orig_dst);
        } else {
index 2b8e385d1e5141a880e312d4a07963e4b7b3b0a7..2c66b356025a7545b73995cb403dc620d706504c 100644 (file)
@@ -44,7 +44,6 @@
 #include <net/sock.h>
 #include <net/ip.h>
 #include <net/udp_tunnel.h>
-#include <net/ipv6_stubs.h>
 #include <linux/tipc_netlink.h>
 #include "core.h"
 #include "addr.h"
@@ -207,9 +206,8 @@ static int tipc_udp_xmit(struct net *net, struct sk_buff *skb,
                                .saddr = src->ipv6,
                                .flowi6_proto = IPPROTO_UDP
                        };
-                       ndst = ipv6_stub->ipv6_dst_lookup_flow(net,
-                                                              ub->ubsock->sk,
-                                                              &fl6, NULL);
+                       ndst = ip6_dst_lookup_flow(net, ub->ubsock->sk,
+                                                  &fl6, NULL);
                        if (IS_ERR(ndst)) {
                                err = PTR_ERR(ndst);
                                goto tx_error;
@@ -418,8 +416,7 @@ static int enable_mcast(struct udp_bearer *ub, struct udp_media_addr *remote)
 #if IS_ENABLED(CONFIG_IPV6)
        } else {
                lock_sock(sk);
-               err = ipv6_stub->ipv6_sock_mc_join(sk, ub->ifindex,
-                                                  &remote->ipv6);
+               err = ipv6_sock_mc_join(sk, ub->ifindex, &remote->ipv6);
                release_sock(sk);
 #endif
        }
index 9988324190971e2221d066900a35dc230dac9f79..a2756186e13a296a18adf3a10397ce58a1557e9a 100644 (file)
@@ -7,9 +7,6 @@
 #include <linux/skmsg.h>
 #include <net/inet_common.h>
 #include <trace/events/sock.h>
-#if IS_ENABLED(CONFIG_IPV6)
-#include <net/ipv6_stubs.h>
-#endif
 #include <net/hotdata.h>
 
 static void handle_nonesp(struct espintcp_ctx *ctx, struct sk_buff *skb,
@@ -43,7 +40,7 @@ static void handle_esp(struct sk_buff *skb, struct sock *sk)
        local_bh_disable();
 #if IS_ENABLED(CONFIG_IPV6)
        if (sk->sk_family == AF_INET6)
-               ipv6_stub->xfrm6_rcv_encap(skb, IPPROTO_ESP, 0, TCP_ENCAP_ESPINTCP);
+               xfrm6_rcv_encap(skb, IPPROTO_ESP, 0, TCP_ENCAP_ESPINTCP);
        else
 #endif
                xfrm4_rcv_encap(skb, IPPROTO_ESP, 0, TCP_ENCAP_ESPINTCP);
index 1856beee0149bbcdf7abd744a71d911543795acb..458931062a04ef6271ec8e7bf8d5a98c8bfd48c0 100644 (file)
@@ -98,14 +98,14 @@ static int nat_keepalive_send_ipv6(struct sk_buff *skb,
        local_lock_nested_bh(&nat_keepalive_sk_ipv6.bh_lock);
        sk = this_cpu_read(nat_keepalive_sk_ipv6.sock);
        sock_net_set(sk, net);
-       dst = ipv6_stub->ipv6_dst_lookup_flow(net, sk, &fl6, NULL);
+       dst = ip6_dst_lookup_flow(net, sk, &fl6, NULL);
        if (IS_ERR(dst)) {
                local_unlock_nested_bh(&nat_keepalive_sk_ipv6.bh_lock);
                return PTR_ERR(dst);
        }
 
        skb_dst_set(skb, dst);
-       err = ipv6_stub->ip6_xmit(sk, skb, &fl6, skb->mark, NULL, 0, 0);
+       err = ip6_xmit(sk, skb, &fl6, skb->mark, NULL, 0, 0);
        sock_net_set(sk, &init_net);
        local_unlock_nested_bh(&nat_keepalive_sk_ipv6.bh_lock);
        return err;
index 54222fcbd7fd81d3b90fbf82749285b33d897990..a9652b422f5121b1a8a55694ab3ec30f3f60acee 100644 (file)
@@ -20,7 +20,6 @@
 
 #if IS_ENABLED(CONFIG_IPV6)
 #include <net/ip6_route.h>
-#include <net/ipv6_stubs.h>
 #endif
 
 #include "xfrm_inout.h"
@@ -900,7 +899,7 @@ int xfrm6_tunnel_check_size(struct sk_buff *skb)
                skb->protocol = htons(ETH_P_IPV6);
 
                if (xfrm6_local_dontfrag(sk))
-                       ipv6_stub->xfrm6_local_rxpmtu(skb, mtu);
+                       xfrm6_local_rxpmtu(skb, mtu);
                else if (sk)
                        xfrm_local_error(skb, mtu);
                else