[Bridge] [PATCH net-next 1/2] net: bridge: change unicast boolean to exact pkt_type

Stephen Hemminger stephen at networkplumber.org
Tue Aug 30 14:59:53 UTC 2016


On Tue, 30 Aug 2016 15:08:58 +0200
Nikolay Aleksandrov <nikolay at cumulusnetworks.com> wrote:

> -	if (!is_broadcast_ether_addr(dest) && is_multicast_ether_addr(dest) &&
> -	    br_multicast_rcv(br, p, skb, vid))
> -		goto drop;
> +	local_rcv = !!(br->dev->flags & IFF_PROMISC);
local_rcv is needlessly initialized in existing code. Pls remove that.

> +	if (is_multicast_ether_addr(dest)) {
> +		/* by definition the broadcast is also a multicast address */
> +		if (is_broadcast_ether_addr(dest)) {
> +			pkt_type = BR_PKT_BROADCAST;
> +			local_rcv = true;
> +		} else {
> +			pkt_type = BR_PKT_MULTICAST;
> +			if (br_multicast_rcv(br, p, skb, vid))
> +				goto drop;
> +		}
> +	}
>


These could go after the BR_STATE_LEARNING check

>  	if (p->state == BR_STATE_LEARNING)
>  		goto drop;
>  
>  	BR_INPUT_SKB_CB(skb)->brdev = br->dev;
>  
> -	local_rcv = !!(br->dev->flags & IFF_PROMISC);
> -
>  	if (IS_ENABLED(CONFIG_INET) && skb->protocol == htons(ETH_P_ARP))
>  		br_do_proxy_arp(skb, br, vid, p);
>

can't proxy_arp change what was a broadcast packet into a unicast packet?


More information about the Bridge mailing list