[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220209180620.3699bf25@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Wed, 9 Feb 2022 18:06:20 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Andrew Lunn <andrew@...n.ch>,
Horatiu Vultur <horatiu.vultur@...rochip.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
UNGLinuxDriver@...rochip.com, davem@...emloft.net,
kernel test robot <lkp@...el.com>
Subject: Re: [PATCH net-next] net: lan966x: Fix when CONFIG_IPV6 is not set
On Wed, 9 Feb 2022 14:54:23 +0100 Andrew Lunn wrote:
> On Wed, Feb 09, 2022 at 11:18:23AM +0100, Horatiu Vultur wrote:
> > When CONFIG_IPV6 is not set, then the compilation of the lan966x driver
compilation or linking?
> > 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 #ifdef around this code.
>
> It might be better to add a stub function for when IPv6 is
> disabled. We try to avoid #if in C code.
If it's linking we can do:
if (IS_ENABLED(CONFIG_IPV6) &&
skb->protocol == htons(ETH_P_IPV6) &&
ipv6_addr_is_multicast(&ipv6_hdr(skb)->daddr) &&
!ipv6_mc_check_mld(skb))
return false;
But beware that IPV6 can be a module, you may need a Kconfig dependency.
Powered by blists - more mailing lists