aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-03-31 16:04:23 -0400
committerDavid S. Miller <davem@davemloft.net>2014-03-31 16:04:23 -0400
commitfea1829f9ba262442ad9fc91cfe9284fa9ea8458 (patch)
treefe623c6c6c86cde1718238329a34b728185cc4f3
parent9109e17f7c3ace48629397b44db5ce06bf168644 (diff)
parentf6367b4660dde412f9b7af94763efb1d89cefb74 (diff)
Merge branch 'bridge_8021AD'
Vlad Yasevich says: ==================== bridge: Fix forwarding of 8021AD frames Bridge has its own way to deterine if the packet is forwardable and it doesn't support 8021ad tags correctly. Instead just allow bridge to use an existing is_skb_forwardable() function. v2: Fix missing hunk in patch 2/2 to make it build. v3: Fix indent for is_skb_forwardable ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/netdevice.h1
-rw-r--r--net/bridge/br_forward.c9
-rw-r--r--net/core/dev.c4
3 files changed, 5 insertions, 9 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 06287c110241..29b579fb5196 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2629,6 +2629,7 @@ int dev_get_phys_port_id(struct net_device *dev,
2629int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, 2629int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
2630 struct netdev_queue *txq); 2630 struct netdev_queue *txq);
2631int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); 2631int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
2632bool is_skb_forwardable(struct net_device *dev, struct sk_buff *skb);
2632 2633
2633extern int netdev_budget; 2634extern int netdev_budget;
2634 2635
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index d3409e6b5453..056b67b0e277 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -35,16 +35,11 @@ static inline int should_deliver(const struct net_bridge_port *p,
35 p->state == BR_STATE_FORWARDING; 35 p->state == BR_STATE_FORWARDING;
36} 36}
37 37
38static inline unsigned int packet_length(const struct sk_buff *skb)
39{
40 return skb->len - (skb->protocol == htons(ETH_P_8021Q) ? VLAN_HLEN : 0);
41}
42
43int br_dev_queue_push_xmit(struct sk_buff *skb) 38int br_dev_queue_push_xmit(struct sk_buff *skb)
44{ 39{
45 /* ip_fragment doesn't copy the MAC header */ 40 /* ip_fragment doesn't copy the MAC header */
46 if (nf_bridge_maybe_copy_header(skb) || 41 if (nf_bridge_maybe_copy_header(skb) ||
47 (packet_length(skb) > skb->dev->mtu && !skb_is_gso(skb))) { 42 !is_skb_forwardable(skb->dev, skb)) {
48 kfree_skb(skb); 43 kfree_skb(skb);
49 } else { 44 } else {
50 skb_push(skb, ETH_HLEN); 45 skb_push(skb, ETH_HLEN);
@@ -71,7 +66,7 @@ static void __br_deliver(const struct net_bridge_port *to, struct sk_buff *skb)
71 skb->dev = to->dev; 66 skb->dev = to->dev;
72 67
73 if (unlikely(netpoll_tx_running(to->br->dev))) { 68 if (unlikely(netpoll_tx_running(to->br->dev))) {
74 if (packet_length(skb) > skb->dev->mtu && !skb_is_gso(skb)) 69 if (!is_skb_forwardable(skb->dev, skb))
75 kfree_skb(skb); 70 kfree_skb(skb);
76 else { 71 else {
77 skb_push(skb, ETH_HLEN); 72 skb_push(skb, ETH_HLEN);
diff --git a/net/core/dev.c b/net/core/dev.c
index cf92139b229c..a923eed976ae 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1640,8 +1640,7 @@ static inline void net_timestamp_set(struct sk_buff *skb)
1640 __net_timestamp(SKB); \ 1640 __net_timestamp(SKB); \
1641 } \ 1641 } \
1642 1642
1643static inline bool is_skb_forwardable(struct net_device *dev, 1643bool is_skb_forwardable(struct net_device *dev, struct sk_buff *skb)
1644 struct sk_buff *skb)
1645{ 1644{
1646 unsigned int len; 1645 unsigned int len;
1647 1646
@@ -1660,6 +1659,7 @@ static inline bool is_skb_forwardable(struct net_device *dev,
1660 1659
1661 return false; 1660 return false;
1662} 1661}
1662EXPORT_SYMBOL_GPL(is_skb_forwardable);
1663 1663
1664/** 1664/**
1665 * dev_forward_skb - loopback an skb to another netif 1665 * dev_forward_skb - loopback an skb to another netif