From a14462f1bd4d3962994f518459102000438665aa Mon Sep 17 00:00:00 2001 From: Jiri Pirko Date: Thu, 6 May 2010 01:33:53 +0000 Subject: 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 Acked-by: Patrick McHardy Signed-off-by: David S. Miller --- drivers/net/macvlan.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'drivers/net') diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 9a939d828b47..1b78c0057a8d 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -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) -- cgit v1.2.3-59-g8ed1b