net: bridge: convert neigh_suppress_enabled option to a bit
Convert the neigh_suppress_enabled option to a bit. Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
675779adbf
commit
c69c2cd444
|
@ -39,7 +39,7 @@ void br_recalculate_neigh_suppress_enabled(struct net_bridge *br)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
br->neigh_suppress_enabled = neigh_suppress;
|
br_opt_toggle(br, BROPT_NEIGH_SUPPRESS_ENABLED, neigh_suppress);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_INET)
|
#if IS_ENABLED(CONFIG_INET)
|
||||||
|
@ -155,7 +155,7 @@ void br_do_proxy_suppress_arp(struct sk_buff *skb, struct net_bridge *br,
|
||||||
ipv4_is_multicast(tip))
|
ipv4_is_multicast(tip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (br->neigh_suppress_enabled) {
|
if (br_opt_get(br, BROPT_NEIGH_SUPPRESS_ENABLED)) {
|
||||||
if (p && (p->flags & BR_NEIGH_SUPPRESS))
|
if (p && (p->flags & BR_NEIGH_SUPPRESS))
|
||||||
return;
|
return;
|
||||||
if (ipv4_is_zeronet(sip) || sip == tip) {
|
if (ipv4_is_zeronet(sip) || sip == tip) {
|
||||||
|
@ -175,7 +175,8 @@ void br_do_proxy_suppress_arp(struct sk_buff *skb, struct net_bridge *br,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (br->neigh_suppress_enabled && br_is_local_ip(vlandev, tip)) {
|
if (br_opt_get(br, BROPT_NEIGH_SUPPRESS_ENABLED) &&
|
||||||
|
br_is_local_ip(vlandev, tip)) {
|
||||||
/* its our local ip, so don't proxy reply
|
/* its our local ip, so don't proxy reply
|
||||||
* and don't forward to neigh suppress ports
|
* and don't forward to neigh suppress ports
|
||||||
*/
|
*/
|
||||||
|
@ -213,7 +214,8 @@ void br_do_proxy_suppress_arp(struct sk_buff *skb, struct net_bridge *br,
|
||||||
/* If we have replied or as long as we know the
|
/* If we have replied or as long as we know the
|
||||||
* mac, indicate to arp replied
|
* mac, indicate to arp replied
|
||||||
*/
|
*/
|
||||||
if (replied || br->neigh_suppress_enabled)
|
if (replied ||
|
||||||
|
br_opt_get(br, BROPT_NEIGH_SUPPRESS_ENABLED))
|
||||||
BR_INPUT_SKB_CB(skb)->proxyarp_replied = true;
|
BR_INPUT_SKB_CB(skb)->proxyarp_replied = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -460,7 +462,8 @@ void br_do_suppress_nd(struct sk_buff *skb, struct net_bridge *br,
|
||||||
* mac, indicate to NEIGH_SUPPRESS ports that we
|
* mac, indicate to NEIGH_SUPPRESS ports that we
|
||||||
* have replied
|
* have replied
|
||||||
*/
|
*/
|
||||||
if (replied || br->neigh_suppress_enabled)
|
if (replied ||
|
||||||
|
br_opt_get(br, BROPT_NEIGH_SUPPRESS_ENABLED))
|
||||||
BR_INPUT_SKB_CB(skb)->proxyarp_replied = true;
|
BR_INPUT_SKB_CB(skb)->proxyarp_replied = true;
|
||||||
}
|
}
|
||||||
neigh_release(n);
|
neigh_release(n);
|
||||||
|
|
|
@ -67,11 +67,11 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
if (IS_ENABLED(CONFIG_INET) &&
|
if (IS_ENABLED(CONFIG_INET) &&
|
||||||
(eth->h_proto == htons(ETH_P_ARP) ||
|
(eth->h_proto == htons(ETH_P_ARP) ||
|
||||||
eth->h_proto == htons(ETH_P_RARP)) &&
|
eth->h_proto == htons(ETH_P_RARP)) &&
|
||||||
br->neigh_suppress_enabled) {
|
br_opt_get(br, BROPT_NEIGH_SUPPRESS_ENABLED)) {
|
||||||
br_do_proxy_suppress_arp(skb, br, vid, NULL);
|
br_do_proxy_suppress_arp(skb, br, vid, NULL);
|
||||||
} else if (IS_ENABLED(CONFIG_IPV6) &&
|
} else if (IS_ENABLED(CONFIG_IPV6) &&
|
||||||
skb->protocol == htons(ETH_P_IPV6) &&
|
skb->protocol == htons(ETH_P_IPV6) &&
|
||||||
br->neigh_suppress_enabled &&
|
br_opt_get(br, BROPT_NEIGH_SUPPRESS_ENABLED) &&
|
||||||
pskb_may_pull(skb, sizeof(struct ipv6hdr) +
|
pskb_may_pull(skb, sizeof(struct ipv6hdr) +
|
||||||
sizeof(struct nd_msg)) &&
|
sizeof(struct nd_msg)) &&
|
||||||
ipv6_hdr(skb)->nexthdr == IPPROTO_ICMPV6) {
|
ipv6_hdr(skb)->nexthdr == IPPROTO_ICMPV6) {
|
||||||
|
|
|
@ -122,7 +122,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
|
||||||
br_do_proxy_suppress_arp(skb, br, vid, p);
|
br_do_proxy_suppress_arp(skb, br, vid, p);
|
||||||
} else if (IS_ENABLED(CONFIG_IPV6) &&
|
} else if (IS_ENABLED(CONFIG_IPV6) &&
|
||||||
skb->protocol == htons(ETH_P_IPV6) &&
|
skb->protocol == htons(ETH_P_IPV6) &&
|
||||||
br->neigh_suppress_enabled &&
|
br_opt_get(br, BROPT_NEIGH_SUPPRESS_ENABLED) &&
|
||||||
pskb_may_pull(skb, sizeof(struct ipv6hdr) +
|
pskb_may_pull(skb, sizeof(struct ipv6hdr) +
|
||||||
sizeof(struct nd_msg)) &&
|
sizeof(struct nd_msg)) &&
|
||||||
ipv6_hdr(skb)->nexthdr == IPPROTO_ICMPV6) {
|
ipv6_hdr(skb)->nexthdr == IPPROTO_ICMPV6) {
|
||||||
|
|
|
@ -318,6 +318,7 @@ enum net_bridge_opts {
|
||||||
BROPT_MULTICAST_QUERY_USE_IFADDR,
|
BROPT_MULTICAST_QUERY_USE_IFADDR,
|
||||||
BROPT_MULTICAST_STATS_ENABLED,
|
BROPT_MULTICAST_STATS_ENABLED,
|
||||||
BROPT_HAS_IPV6_ADDR,
|
BROPT_HAS_IPV6_ADDR,
|
||||||
|
BROPT_NEIGH_SUPPRESS_ENABLED,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct net_bridge {
|
struct net_bridge {
|
||||||
|
@ -414,7 +415,6 @@ struct net_bridge {
|
||||||
#ifdef CONFIG_NET_SWITCHDEV
|
#ifdef CONFIG_NET_SWITCHDEV
|
||||||
int offload_fwd_mark;
|
int offload_fwd_mark;
|
||||||
#endif
|
#endif
|
||||||
bool neigh_suppress_enabled;
|
|
||||||
bool mtu_set_by_user;
|
bool mtu_set_by_user;
|
||||||
struct hlist_head fdb_list;
|
struct hlist_head fdb_list;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue