Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195132
b: refs/heads/master
c: a14462f
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Pirko authored and David S. Miller committed May 16, 2010
1 parent a135832 commit 6a29b11
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 10fc51b9953112ade61e33ff2f6f005f005a2361
refs/heads/master: a14462f1bd4d3962994f518459102000438665aa
8 changes: 2 additions & 6 deletions trunk/drivers/net/macvlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/if_macvlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
struct net_device *dev);


extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *);
extern struct sk_buff *(*macvlan_handle_frame_hook)(struct macvlan_port *,
struct sk_buff *);

#endif /* _LINUX_IF_MACVLAN_H */
10 changes: 7 additions & 3 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2612,22 +2612,26 @@ static inline struct sk_buff *handle_bridge(struct sk_buff *skb,
#endif

#if defined(CONFIG_MACVLAN) || defined(CONFIG_MACVLAN_MODULE)
struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *skb) __read_mostly;
struct sk_buff *(*macvlan_handle_frame_hook)(struct macvlan_port *p,
struct sk_buff *skb) __read_mostly;
EXPORT_SYMBOL_GPL(macvlan_handle_frame_hook);

static inline struct sk_buff *handle_macvlan(struct sk_buff *skb,
struct packet_type **pt_prev,
int *ret,
struct net_device *orig_dev)
{
if (skb->dev->macvlan_port == NULL)
struct macvlan_port *port;

port = rcu_dereference(skb->dev->macvlan_port);
if (!port)
return skb;

if (*pt_prev) {
*ret = deliver_skb(skb, *pt_prev, orig_dev);
*pt_prev = NULL;
}
return macvlan_handle_frame_hook(skb);
return macvlan_handle_frame_hook(port, skb);
}
#else
#define handle_macvlan(skb, pt_prev, ret, orig_dev) (skb)
Expand Down

0 comments on commit 6a29b11

Please sign in to comment.