[PATCH] wireguard: remove unnecessary use of ipv6_stub
Torin Carey
torin at tcarey.uk
Thu Sep 18 12:33:03 UTC 2025
ipv6_stub is required for cases where ipv6 may be compiled as a module
and might not be loaded from a given context.
wireguard has a Kconfig dependence of IPV6 || !IPV6 so will also be compiled
as a module if ipv6 is, and wireguard already accesses a symbol of this module
via ipv6_mod_enabled, so already has a module dependence on ipv6.
Removal is desireable since it removes an unnecessary indirect branch, but
also reduces the effort needed should ipv6_stub ever be modified/replaced.
Signed-off-by: Torin Carey <torin at tcarey.uk>
---
drivers/net/wireguard/socket.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireguard/socket.c b/drivers/net/wireguard/socket.c
index 253488f8c00f..593324d564d2 100644
--- a/drivers/net/wireguard/socket.c
+++ b/drivers/net/wireguard/socket.c
@@ -136,8 +136,8 @@ static int send6(struct wg_device *wg, struct sk_buff *skb,
if (cache)
dst_cache_reset(cache);
}
- dst = ipv6_stub->ipv6_dst_lookup_flow(sock_net(sock), sock, &fl,
- NULL);
+ dst = ip6_dst_lookup_flow(sock_net(sock), sock, &fl,
+ NULL);
if (IS_ERR(dst)) {
ret = PTR_ERR(dst);
net_dbg_ratelimited("%s: No route to %pISpfsc, error %d\n",
base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
--
2.48.1
More information about the WireGuard
mailing list