diff mbox

[net-next] tipc: fix undefined __ipv6_sock_mc_join compile error

Message ID 1425953333-31403-1-git-send-email-ying.xue@windriver.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Ying Xue March 10, 2015, 2:08 a.m. UTC
When CONFIG_IPV6 option is disabled, below compile error appears while
building TIPC module:

ERROR: "__ipv6_sock_mc_join" [net/tipc/tipc.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [net/tipc/tipc.ko] Error 1

This is because we don't check whether or not the CONFIG_IPV6 is
enabled when calling __ipv6_sock_mc_join().

Fixes: d0f91938bede ("tipc: add ip/udp media type")
Reported-by: Wu Fengguang <fengguang.wu@intel.com>
Cc: Kbuild test robot <kbuild-all@01.org>
Signed-off-by: Ying Xue <ying.xue@windriver.com>
---
 net/tipc/udp_media.c |    2 ++
 1 file changed, 2 insertions(+)

Comments

David Miller March 10, 2015, 2:37 a.m. UTC | #1
From: Ying Xue <ying.xue@windriver.com>
Date: Tue, 10 Mar 2015 10:08:52 +0800

> When CONFIG_IPV6 option is disabled, below compile error appears while
> building TIPC module:
> 
> ERROR: "__ipv6_sock_mc_join" [net/tipc/tipc.ko] undefined!
> make[1]: *** [__modpost] Error 1
> make: *** [net/tipc/tipc.ko] Error 1
> 
> This is because we don't check whether or not the CONFIG_IPV6 is
> enabled when calling __ipv6_sock_mc_join().
> 
> Fixes: d0f91938bede ("tipc: add ip/udp media type")
> Reported-by: Wu Fengguang <fengguang.wu@intel.com>
> Cc: Kbuild test robot <kbuild-all@01.org>
> Signed-off-by: Ying Xue <ying.xue@windriver.com>

Unfortunately, that's not sufficient.

You also need Kconfig guards to prevent building TIPC=y,
TIPC_MEDIA_UDP=y, and IPV6=m which will not work.

Look at other users of ipv6_*() interface, such as L2TP.
You need a dependency like (IPV6 || IPV6=n).
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c
index fc2fb11..6763002 100644
--- a/net/tipc/udp_media.c
+++ b/net/tipc/udp_media.c
@@ -247,10 +247,12 @@  static int enable_mcast(struct udp_bearer *ub, struct udp_media_addr *remote)
 		mreqn.imr_multiaddr = remote->ipv4;
 		mreqn.imr_ifindex = ub->ifindex;
 		err = __ip_mc_join_group(sk, &mreqn);
+#if IS_ENABLED(CONFIG_IPV6)
 	} else {
 		if (!ipv6_addr_is_multicast(&remote->ipv6))
 			return 0;
 		err = __ipv6_sock_mc_join(sk, ub->ifindex, &remote->ipv6);
+#endif
 	}
 	return err;
 }