Skip to content

Commit

Permalink
tipc: fix build issue when building without IPv6
Browse files Browse the repository at this point in the history
We can't directly call ipv6_sock_mc_join() but should use the stub
instead and protect it around IS_ENABLED.

Fixes: d0f9193 ("tipc: add ip/udp media type")
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Marcelo Ricardo Leitner authored and David S. Miller committed Mar 19, 2015
1 parent d15b1de commit 446981e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/tipc/udp_media.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <net/sock.h>
#include <net/ip.h>
#include <net/udp_tunnel.h>
#include <net/addrconf.h>
#include <linux/tipc_netlink.h>
#include "core.h"
#include "bearer.h"
Expand Down Expand Up @@ -247,10 +248,13 @@ 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);
err = ipv6_stub->ipv6_sock_mc_join(sk, ub->ifindex,
&remote->ipv6);
#endif
}
return err;
}
Expand Down

0 comments on commit 446981e

Please sign in to comment.