|
@@ -118,8 +118,6 @@ static int macvlan_broadcast_one(struct sk_buff *skb,
|
|
|
const struct ethhdr *eth, bool local)
|
|
|
{
|
|
|
struct net_device *dev = vlan->dev;
|
|
|
- if (!skb)
|
|
|
- return NET_RX_DROP;
|
|
|
|
|
|
if (local)
|
|
|
return vlan->forward(dev, skb);
|
|
@@ -171,9 +169,13 @@ static void macvlan_broadcast(struct sk_buff *skb,
|
|
|
hash = mc_hash(vlan, eth->h_dest);
|
|
|
if (!test_bit(hash, vlan->mc_filter))
|
|
|
continue;
|
|
|
+
|
|
|
+ err = NET_RX_DROP;
|
|
|
nskb = skb_clone(skb, GFP_ATOMIC);
|
|
|
- err = macvlan_broadcast_one(nskb, vlan, eth,
|
|
|
- mode == MACVLAN_MODE_BRIDGE);
|
|
|
+ if (likely(nskb))
|
|
|
+ err = macvlan_broadcast_one(
|
|
|
+ nskb, vlan, eth,
|
|
|
+ mode == MACVLAN_MODE_BRIDGE);
|
|
|
macvlan_count_rx(vlan, skb->len + ETH_HLEN,
|
|
|
err == NET_RX_SUCCESS, 1);
|
|
|
}
|