]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
geneve: Move udp_conf.local_ip6 under CONFIG_IPV6 in geneve_create_sock().
authorKuniyuki Iwashima <kuniyu@google.com>
Sat, 6 Jun 2026 20:48:46 +0000 (20:48 +0000)
committerJakub Kicinski <kuba@kernel.org>
Mon, 8 Jun 2026 22:58:16 +0000 (15:58 -0700)
Unlike struct ip_tunnel_key, struct udp_port_cfg does not always
define IPv6 address fields.

  >> 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.")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202606070019.yx2LhZPU-lkp@intel.com/
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260606204848.1987046-1-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/geneve.c

index a60e16bbb2c9334dfc071689a5ee52f929bea2bc..23b42466a7c9dddf268000f04bc4a1fa62bfdce2 100644 (file)
@@ -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;
        }