bridge: only provide proxy ARP when CONFIG_INET is enabled
Subsystems (3)
PATCH 1/1 bridge: only provide proxy ARP when CONFIG_INET is enabled
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.
net/bridge/br_input.c +2 -1
@@ -154,7 +154,8 @@ int br_handle_frame_finish(struct sk_buff *skb) dst =NULL ;if (is_broadcast_ether_addr (dest)) { -if (p->flags &BR_PROXYARP && +if (IS_ENABLED (CONFIG_INET ) && + p->flags &BR_PROXYARP && skb->protocol ==htons (ETH_P_ARP ))br_do_proxy_arp (skb, br, vid);
Quoted 11 lines · Arnd Bergmann
When IPV4 support is disabled, we cannot call
arp_sendfrom 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 toarp_send' :(.text+0x59a50): undefined reference toarp_tbl'This makes the newly added proxy ARP support in the bridge code depend on the
CONFIG_INETsymbol 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.
David Miller
maintainerFrom: Cong Wang <[email protected]>
Date: Tue, 13 Jan 2015 11:25:45 -0800
Quoted 8 lines · Arnd Bergmann
Quoted 7 lines
When IPV4 support is disabled, we cannot call
arp_sendfrom 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 toarp_send' :(.text+0x59a50): undefined reference toarp_tbl'
Quoted 7 lines
Quoted 4 lines
This makes the newly added proxy ARP support in the bridge code depend on the
CONFIG_INETsymbol and lets the compiler optimize the code out to avoid the link error.Not sure how much sense to make
CONFIG_BRIDGEdepend onCONFIG_INET, at leastCONFIG_BONDINGdoes.
It depends upon whether we want to provide and consider as a valid configuration bridging without INET. Probably we do.
Quoted 16 lines · David Miller
From: Cong Wang <[email protected]>
Date: Tue, 13 Jan 2015 11:25:45 -0800Quoted 13 lines · Arnd Bergmann
Quoted 11 lines
When IPV4 support is disabled, we cannot call
arp_sendfrom 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 toarp_send' :(.text+0x59a50): undefined reference toarp_tbl'This makes the newly added proxy ARP support in the bridge code depend on the
CONFIG_INETsymbol and lets the compiler optimize the code out to avoid the link error.
Quoted 6 lines
Quoted 2 lines
Not sure how much sense to make
CONFIG_BRIDGEdepend onCONFIG_INET, at leastCONFIG_BONDINGdoes.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
Quoted 5 lines · On Tuesday 13 January 2015 14:14:20 David Ahern wrote:
Rather than connect
CONFIG_BRIDGEtoCONFIG_INET, why not makebr_do_proxy_arp(and settingBR_PROXYARPflag) a no-op ifCONFIG_INETis not set?
Quoted 8 lines
#ifdef
CONFIG_INET
#else
static inline voidbr_do_proxy_arp(...args...)
{
}
#endifThat covers both
arp_tblandarp_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
Quoted 4 lines · Arnd Bergmann
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.
Indeed. As long as br_do_proxy_arp does not get exported that works the same.
David
From: Arnd Bergmann <[email protected]>
Date: Tue, 13 Jan 2015 15:10:27 +0100
Quoted 7 lines
When IPV4 support is disabled, we cannot call
arp_sendfrom 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 toarp_send' :(.text+0x59a50): undefined reference toarp_tbl'
Quoted 6 lines
This makes the newly added proxy ARP support in the bridge code depend on the
CONFIG_INETsymbol and lets the compiler optimize the code out to avoid the link error.Signed-off-by Arnd Bergmann <[email protected]>Fixes 958501163ddd ("bridge: Add support for IEEE 802.11 Proxy ARP")
Applied, thanks Arnd.