Skip to contentSkip to conversation

geneve: Move udp_conf.local_ip6 under CONFIG_IPV6 in geneve_create_sock().

PATCH Applied Kuniyuki Iwashima 2 participants 2 messages Jun 6 – Jun 9

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 geneve: Move udp_conf.local_ip6 under CONFIG_IPV6 in geneve_create_sock().

Unlike struct ip_tunnel_key, struct udp_port_cfg does not always define IPv6 address fields.

Quoted 1 line
Quoted 1 line

drivers/net/geneve.c:778:12: error: no member named 'local_ip6' in 'struct udp_port_cfg'

       778 |                 udp_conf.local_ip6 = info->key.u.ipv6.src;
           |                 ~~~~~~~~ ^

Let's add CONFIG_IPV6 guard in geneve_create_sock().

Fixes afabbb56a726 ("geneve: Introduce IFLA_GENEVE_LOCAL and IFLA_GENEVE_LOCAL6.")
---
 drivers/net/geneve.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/geneve.c +4 -1
index a60e16bbb2c9..23b42466a7c9 100644
@@ -771,12 +771,15 @@ static struct sock *geneve_create_sock(struct net *net,
 
 	memset(&udp_conf, 0, sizeof(udp_conf));
 
+#if IS_ENABLED(CONFIG_IPV6)
 	if (ipv6) {
 		udp_conf.family = AF_INET6;
 		udp_conf.ipv6_v6only = 1;
 		udp_conf.use_udp6_rx_checksums = geneve->cfg.use_udp6_rx_checksums;
 		udp_conf.local_ip6 = info->key.u.ipv6.src;
-	} else {
+	} else
+#endif
+	{
 		udp_conf.family = AF_INET;
 		udp_conf.local_ip.s_addr = info->key.u.ipv4.src;
 	}
Signature · 1 line
2.54.0.1032.g2f8565e1d1-goog
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Sat, 6 Jun 2026 20:48:46 +0000 you wrote:

Unlike struct ip_tunnel_key, struct udp_port_cfg does not always define IPv6 address fields.

Quoted 1 line
Quoted 1 line

drivers/net/geneve.c:778:12: error: no member named 'local_ip6' in 'struct udp_port_cfg'

       778 |                 udp_conf.local_ip6 = info->key.u.ipv6.src;
           |                 ~~~~~~~~ ^

[...]

Here is the summary with links:
- [v1,net-next] geneve: Move udp_conf.local_ip6 under CONFIG_IPV6 in geneve_create_sock().

    https://git.kernel.org/netdev/net-next/c/4728f2509f2b

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html