David Miller
2015-Jan-13 20:57 UTC
[Bridge] [PATCH] bridge: only provide proxy ARP when CONFIG_INET is enabled
From: Cong Wang <cwang at twopensource.com> Date: Tue, 13 Jan 2015 11:25:45 -0800> On Tue, Jan 13, 2015 at 6:10 AM, Arnd Bergmann <arnd at arndb.de> wrote: >> When IPV4 support is disabled, we cannot call arp_send from >> the bridge code, which would result in a kernel link error: >> >> net/built-in.o: In function `br_handle_frame_finish': >> :(.text+0x59914): undefined reference to `arp_send' >> :(.text+0x59a50): undefined reference to `arp_tbl' >> >> This makes the newly added proxy ARP support in the bridge >> code depend on the CONFIG_INET symbol and lets the compiler >> optimize the code out to avoid the link error. >> > > Not sure how much sense to make CONFIG_BRIDGE depend > on CONFIG_INET, at least CONFIG_BONDING does.It depends upon whether we want to provide and consider as a valid configuration bridging without INET. Probably we do.
David Ahern
2015-Jan-13 21:14 UTC
[Bridge] [PATCH] bridge: only provide proxy ARP when CONFIG_INET is enabled
On 1/13/15 1:57 PM, David Miller wrote:> From: Cong Wang <cwang at twopensource.com> > Date: Tue, 13 Jan 2015 11:25:45 -0800 > >> On Tue, Jan 13, 2015 at 6:10 AM, Arnd Bergmann <arnd at arndb.de> wrote: >>> When IPV4 support is disabled, we cannot call arp_send from >>> the bridge code, which would result in a kernel link error: >>> >>> net/built-in.o: In function `br_handle_frame_finish': >>> :(.text+0x59914): undefined reference to `arp_send' >>> :(.text+0x59a50): undefined reference to `arp_tbl' >>> >>> This makes the newly added proxy ARP support in the bridge >>> code depend on the CONFIG_INET symbol and lets the compiler >>> optimize the code out to avoid the link error. >>> >> >> Not sure how much sense to make CONFIG_BRIDGE depend >> on CONFIG_INET, at least CONFIG_BONDING does. > > It depends upon whether we want to provide and consider > as a valid configuration bridging without INET. Probably > we do.Rather than connect CONFIG_BRIDGE to CONFIG_INET, why not make br_do_proxy_arp (and setting BR_PROXYARP flag) a no-op if CONFIG_INET is not set? #ifdef CONFIG_INET #else static inline void br_do_proxy_arp(...args...) { } #endif That covers both arp_tbl and arp_send. David
Arnd Bergmann
2015-Jan-13 21:33 UTC
[Bridge] [PATCH] bridge: only provide proxy ARP when CONFIG_INET is enabled
On Tuesday 13 January 2015 14:14:20 David Ahern wrote:> > Rather than connect CONFIG_BRIDGE to CONFIG_INET, why not make > br_do_proxy_arp (and setting BR_PROXYARP flag) a no-op if CONFIG_INET is > not set? > > #ifdef CONFIG_INET > #else > static inline void br_do_proxy_arp(...args...) > { > } > #endif > > That covers both arp_tbl and arp_send.The effect is very similar to my patch (probably same object code), the only difference should be that it would add an ugly #ifdef instead of the preferred IS_ENABLED() check, so you don't get any compile-time coverage of the function. It's not really important because everybody has CONFIG_INET enabled in practice and it does get more than enough compile-time coverage. Arnd