Skip to contentSkip to conversation

bridge: make proxy arp configurable

PATCH In review Stephen Hemminger 2 participants 2 messages Nov 30, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 bridge: make proxy arp configurable

This solves kernel build without INET enabled, and allows user to control enabling this feature.

---
 net/bridge/Kconfig       |   15 +++++++++++++++
 net/bridge/br_input.c    |    4 ++++
 net/bridge/br_sysfs_if.c |    4 ++++
 3 files changed, 23 insertions(+)
net/bridge/Kconfig +15 -0
@@ -60,3 +60,18 @@ config BRIDGE_VLAN_FILTERING
 	  Say N to exclude this support and reduce the binary size.
 
 	  If unsure, say Y.
+
+config BRIDGE_ARP_PROXY
+	bool "ARP proxying"
+	depends on BRIDGE
+	depends on INET
+	default y
+	---help---
+	  If you say Y here, then the Ethernet bridge to keep track of
+	  the hardware address to IP address mapping.
+
+	  It is most useful when used as a wireless AP.
+
+	  Say N to exclude this support and reduce the binary size.
+
+	  If unsure, say Y.
net/bridge/br_input.c +4 -0
@@ -59,6 +59,7 @@ static int br_pass_frame_up(struct sk_bu
 		       netif_receive_skb);
 }
 
+#ifdef CONFIG_BRIDGE_PROXY_ARP
 static void br_do_proxy_arp(struct sk_buff *skb, struct net_bridge *br,
 			    u16 vid)
 {
@@ -112,6 +113,7 @@ static void br_do_proxy_arp(struct sk_bu
 		neigh_release(n);
 	}
 }
+#endif
 
 /* note: already called with rcu_read_lock */
 int br_handle_frame_finish(struct sk_buff *skb)
@@ -154,9 +156,11 @@ int br_handle_frame_finish(struct sk_buf
 	dst = NULL;
 
 	if (is_broadcast_ether_addr(dest)) {
+#ifdef CONFIG_BRIDGE_PROXY_ARP
 		if (p->flags & BR_PROXYARP &&
 		    skb->protocol == htons(ETH_P_ARP))
 			br_do_proxy_arp(skb, br, vid);
+#endif
 
 		skb2 = skb;
 		unicast = false;
net/bridge/br_sysfs_if.c +4 -0
@@ -170,7 +170,9 @@ BRPORT_ATTR_FLAG(bpdu_guard, BR_BPDU_GUA
 BRPORT_ATTR_FLAG(root_block, BR_ROOT_BLOCK);
 BRPORT_ATTR_FLAG(learning, BR_LEARNING);
 BRPORT_ATTR_FLAG(unicast_flood, BR_FLOOD);
+#ifdef CONFIG_BRIDGE_PROXY_ARP
 BRPORT_ATTR_FLAG(proxyarp, BR_PROXYARP);
+#endif
 
 #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
 static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf)
@@ -214,7 +216,9 @@ static const struct brport_attribute *br
 	&brport_attr_multicast_router,
 	&brport_attr_multicast_fast_leave,
 #endif
+#ifdef CONFIG_BRIDGE_PROXY_ARP
 	&brport_attr_proxyarp,
+#endif
 	NULL
 };
 
#1 lore raw

Hello Stephen,

Quoted 15 lines · Stephen Hemminger

This solves kernel build without INET enabled, and allows user to control enabling this feature.

---
 net/bridge/Kconfig       |   15 +++++++++++++++
 net/bridge/br_input.c    |    4 ++++
 net/bridge/br_sysfs_if.c |    4 ++++
 3 files changed, 23 insertions(+)

net/bridge/Kconfig config BRIDGE_VLAN_FILTERING · line 64

Quoted 5 lines
net/bridge/Kconfig +2 -0
@@ -60,3 +60,18 @@ config BRIDGE_VLAN_FILTERING
 	  Say N to exclude this support and reduce the binary size.
 
 	  If unsure, say Y.
+
+config BRIDGE_ARP_PROXY

Shouldn't this be BRIDGE_PROXY_ARP to match all the

  #ifdef CONFIG_BRIDGE_PROXY_ARP

below?

Quoted 15 lines
net/bridge/br_input.c +2 -0
@@ -59,6 +59,7 @@ static int br_pass_frame_up(struct sk_bu
 		       netif_receive_skb);
 }
 
+#ifdef CONFIG_BRIDGE_PROXY_ARP
 static void br_do_proxy_arp(struct sk_buff *skb, struct net_bridge *br,
 			    u16 vid)
 {
@@ -112,6 +113,7 @@ static void br_do_proxy_arp(struct sk_bu
 		neigh_release(n);
 	}
 }
+#endif
Signature · 1 line
Sabrina