mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
macvlan: use skb_reset_mac_header() in macvlan_queue_xmit()
[ Upstream commit 1712b2fff8c682d145c7889d2290696647d82dab ]
I missed the fact that macvlan_broadcast() can be used both
in RX and TX.
skb_eth_hdr() makes only sense in TX paths, so we can not
use it blindly in macvlan_broadcast()
Fixes: 96cc4b69581d ("macvlan: do not assume mac_header is set in macvlan_broadcast()")
Signed-off-by: Eric Dumazet <[email protected]>
Reported-by: Jurgen Van Ham <[email protected]>
Tested-by: Matteo Croce <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
7c69f6a227
commit
c17e025049
1 changed files with 3 additions and 2 deletions
|
|
@ -259,7 +259,7 @@ static void macvlan_broadcast(struct sk_buff *skb,
|
|||
struct net_device *src,
|
||||
enum macvlan_mode mode)
|
||||
{
|
||||
const struct ethhdr *eth = skb_eth_hdr(skb);
|
||||
const struct ethhdr *eth = eth_hdr(skb);
|
||||
const struct macvlan_dev *vlan;
|
||||
struct sk_buff *nskb;
|
||||
unsigned int i;
|
||||
|
|
@ -513,10 +513,11 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
const struct macvlan_dev *dest;
|
||||
|
||||
if (vlan->mode == MACVLAN_MODE_BRIDGE) {
|
||||
const struct ethhdr *eth = (void *)skb->data;
|
||||
const struct ethhdr *eth = skb_eth_hdr(skb);
|
||||
|
||||
/* send to other bridge ports directly */
|
||||
if (is_multicast_ether_addr(eth->h_dest)) {
|
||||
skb_reset_mac_header(skb);
|
||||
macvlan_broadcast(skb, port, dev, MACVLAN_MODE_BRIDGE);
|
||||
goto xmit_world;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue