Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: lan966x: Fix when CONFIG_IPV6 is not set

When CONFIG_IPV6 is not set, then the linking of the lan966x driver
fails with the following error:

drivers/net/ethernet/microchip/lan966x/lan966x_main.c:444: undefined
reference to `ipv6_mc_check_mld'

The fix consists in adding a check also for IS_ENABLED(CONFIG_IPV6)

Fixes: 47aeea0d57e80c ("net: lan966x: Implement the callback SWITCHDEV_ATTR_ID_BRIDGE_MC_DISABLED")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Horatiu Vultur and committed by
David S. Miller
867b1db8 1da52b0e

+2 -1
+2 -1
drivers/net/ethernet/microchip/lan966x/lan966x_main.c
··· 439 439 ip_hdr(skb)->protocol == IPPROTO_IGMP) 440 440 return false; 441 441 442 - if (skb->protocol == htons(ETH_P_IPV6) && 442 + if (IS_ENABLED(CONFIG_IPV6) && 443 + skb->protocol == htons(ETH_P_IPV6) && 443 444 ipv6_addr_is_multicast(&ipv6_hdr(skb)->daddr) && 444 445 !ipv6_mc_check_mld(skb)) 445 446 return false;