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

Nikolay Aleksandrov nikolay at cumulusnetworks.com
Tue Aug 30 15:00:41 UTC 2016


On 30/08/16 16:59, Stephen Hemminger wrote:
> 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.
> 

Please check again, I did remove it in this patch.

>> +	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

They can't because of br_multicast_rcv().

> 
>>  	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