Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+5 -9
+1
include/linux/netdevice.h
··· 2629 2629 int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, 2630 2630 struct netdev_queue *txq); 2631 2631 int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); 2632 + bool is_skb_forwardable(struct net_device *dev, struct sk_buff *skb); 2632 2633 2633 2634 extern int netdev_budget; 2634 2635
+2 -7
net/bridge/br_forward.c
··· 35 35 p->state == BR_STATE_FORWARDING; 36 36 } 37 37 38 - static 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 - 43 38 int br_dev_queue_push_xmit(struct sk_buff *skb) 44 39 { 45 40 /* ip_fragment doesn't copy the MAC header */ 46 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 43 kfree_skb(skb); 49 44 } else { 50 45 skb_push(skb, ETH_HLEN); ··· 66 71 skb->dev = to->dev; 67 72 68 73 if (unlikely(netpoll_tx_running(to->br->dev))) { 69 - if (packet_length(skb) > skb->dev->mtu && !skb_is_gso(skb)) 74 + if (!is_skb_forwardable(skb->dev, skb)) 70 75 kfree_skb(skb); 71 76 else { 72 77 skb_push(skb, ETH_HLEN);
+2 -2
net/core/dev.c
··· 1640 1640 __net_timestamp(SKB); \ 1641 1641 } \ 1642 1642 1643 - static inline bool is_skb_forwardable(struct net_device *dev, 1644 - struct sk_buff *skb) 1643 + bool is_skb_forwardable(struct net_device *dev, struct sk_buff *skb) 1645 1644 { 1646 1645 unsigned int len; 1647 1646 ··· 1659 1660 1660 1661 return false; 1661 1662 } 1663 + EXPORT_SYMBOL_GPL(is_skb_forwardable); 1662 1664 1663 1665 /** 1664 1666 * dev_forward_skb - loopback an skb to another netif