You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
net: adjust handle_macvlan to pass port struct to hook
Now there's null check here and also again in the hook. Looking at bridge bits which are simmilar, port structure is rcu_dereferenced right away in handle_bridge and passed to hook. Looks nicer. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
10fc51b995
commit
a14462f1bd
@@ -145,19 +145,15 @@ static void macvlan_broadcast(struct sk_buff *skb,
|
||||
}
|
||||
|
||||
/* called under rcu_read_lock() from netif_receive_skb */
|
||||
static struct sk_buff *macvlan_handle_frame(struct sk_buff *skb)
|
||||
static struct sk_buff *macvlan_handle_frame(struct macvlan_port *port,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
const struct ethhdr *eth = eth_hdr(skb);
|
||||
const struct macvlan_port *port;
|
||||
const struct macvlan_dev *vlan;
|
||||
const struct macvlan_dev *src;
|
||||
struct net_device *dev;
|
||||
unsigned int len;
|
||||
|
||||
port = rcu_dereference(skb->dev->macvlan_port);
|
||||
if (port == NULL)
|
||||
return skb;
|
||||
|
||||
if (is_multicast_ether_addr(eth->h_dest)) {
|
||||
src = macvlan_hash_lookup(port, eth->h_source);
|
||||
if (!src)
|
||||
|
||||
Reference in New Issue
Block a user