Re: Sending 802.1Q packets using AF_PACKET socket on filtered bridge forwards with wrong MAC addresses

2017-12-05 Thread Toshiaki Makita
Hi, (CC: Vlad) On 2017/11/30 7:01, Brandon Carpenter wrote: > I narrowed the search to a memmove() called from > skb_reorder_vlan_header() in net/core/skbuff.c. > >> memmove(skb->data - ETH_HLEN, skb->data - skb->mac_len - VLAN_HLEN, >>2 * ETH_ALEN); > > Calling skb_reset_mac_len()

Re: Sending 802.1Q packets using AF_PACKET socket on filtered bridge forwards with wrong MAC addresses

2017-12-05 Thread Toshiaki Makita
Hi, (CC: Vlad) On 2017/11/30 7:01, Brandon Carpenter wrote: > I narrowed the search to a memmove() called from > skb_reorder_vlan_header() in net/core/skbuff.c. > >> memmove(skb->data - ETH_HLEN, skb->data - skb->mac_len - VLAN_HLEN, >>2 * ETH_ALEN); > > Calling skb_reset_mac_len()

Re: Sending 802.1Q packets using AF_PACKET socket on filtered bridge forwards with wrong MAC addresses

2017-11-29 Thread Brandon Carpenter
I narrowed the search to a memmove() called from skb_reorder_vlan_header() in net/core/skbuff.c. > memmove(skb->data - ETH_HLEN, skb->data - skb->mac_len - VLAN_HLEN, >2 * ETH_ALEN); Calling skb_reset_mac_len() after skb_reset_mac_header() before calling br_allowed_ingress() in

Re: Sending 802.1Q packets using AF_PACKET socket on filtered bridge forwards with wrong MAC addresses

2017-11-29 Thread Brandon Carpenter
I narrowed the search to a memmove() called from skb_reorder_vlan_header() in net/core/skbuff.c. > memmove(skb->data - ETH_HLEN, skb->data - skb->mac_len - VLAN_HLEN, >2 * ETH_ALEN); Calling skb_reset_mac_len() after skb_reset_mac_header() before calling br_allowed_ingress() in

Re: Sending 802.1Q packets using AF_PACKET socket on filtered bridge forwards with wrong MAC addresses

2017-11-28 Thread Brandon Carpenter
I tracked down the function responsible for changing the MAC header. It is skb_vlan_untag() called from __allowed_ingress() in net/bridge/br_vlan.c. Before skb_vlan_untag() is called, the MAC headers are perfect and afterward they are altered as previously described. I'll continue digging into

Re: Sending 802.1Q packets using AF_PACKET socket on filtered bridge forwards with wrong MAC addresses

2017-11-28 Thread Brandon Carpenter
I tracked down the function responsible for changing the MAC header. It is skb_vlan_untag() called from __allowed_ingress() in net/bridge/br_vlan.c. Before skb_vlan_untag() is called, the MAC headers are perfect and afterward they are altered as previously described. I'll continue digging into

Sending 802.1Q packets using AF_PACKET socket on filtered bridge forwards with wrong MAC addresses

2017-11-28 Thread Brandon Carpenter
While attempting to send ARP DAD packets on a bridge device, I noticed that hosts attached to the bridge ports were not responding. After digging in with tcpdump/wireshark, I noticed that the MAC addresses of the packets (the first 12 bytes of the Ethernet frame) were wrong and were an exact

Sending 802.1Q packets using AF_PACKET socket on filtered bridge forwards with wrong MAC addresses

2017-11-28 Thread Brandon Carpenter
While attempting to send ARP DAD packets on a bridge device, I noticed that hosts attached to the bridge ports were not responding. After digging in with tcpdump/wireshark, I noticed that the MAC addresses of the packets (the first 12 bytes of the Ethernet frame) were wrong and were an exact