diff -rU3 linux-2.6.17.7/include/linux/if_bonding.h linux-2.6.17.7-wapper/include/linux/if_bonding.h --- linux-2.6.17.7/include/linux/if_bonding.h 2006-07-25 05:36:01.000000000 +0200 +++ linux-2.6.17.7-wapper/include/linux/if_bonding.h 2006-07-27 21:17:25.000000000 +0200 @@ -46,6 +46,7 @@ #include #include #include +#include /* userland - kernel ABI version (2003/05/08) */ #define BOND_ABI_VERSION 2 @@ -110,6 +111,37 @@ __u8 partner_system[ETH_ALEN]; }; +static inline struct net_device *skb_bond(struct sk_buff *skb) +{ + struct net_device *dev = skb->dev; + + if (dev->master) { + /* + * On bonding slaves other than the currently active + * slave, suppress duplicates except for 802.3ad + * ETH_P_SLOW and alb non-mcast/bcast. + */ + if (dev->priv_flags & IFF_SLAVE_INACTIVE) { + if (dev->master->priv_flags & IFF_MASTER_ALB) { + if (skb->pkt_type != PACKET_BROADCAST && + skb->pkt_type != PACKET_MULTICAST) + goto keep; + } + + if (dev->master->priv_flags & IFF_MASTER_8023AD && + skb->protocol == __constant_htons(ETH_P_SLOW)) + goto keep; + + kfree_skb(skb); + return NULL; + } +keep: + skb->dev = dev->master; + } + + return dev; +} + #endif /* _LINUX_IF_BONDING_H */ /* diff -rU3 linux-2.6.17.7/include/linux/if_vlan.h linux-2.6.17.7-wapper/include/linux/if_vlan.h --- linux-2.6.17.7/include/linux/if_vlan.h 2006-07-25 05:36:01.000000000 +0200 +++ linux-2.6.17.7-wapper/include/linux/if_vlan.h 2006-07-27 20:16:36.000000000 +0200 @@ -24,6 +24,7 @@ struct hlist_node; #include /* for proc_dir_entry */ +#include /* for skb_bond */ #include #define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header) @@ -154,6 +155,12 @@ unsigned short vlan_tag, int polling) { struct net_device_stats *stats; + struct net_device *orig_dev; + + orig_dev = skb_bond(skb); + + if (!orig_dev) + return NET_RX_DROP; skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK]; if (skb->dev == NULL) { diff -rU3 linux-2.6.17.7/net/core/dev.c linux-2.6.17.7-wapper/net/core/dev.c --- linux-2.6.17.7/net/core/dev.c 2006-07-25 05:36:01.000000000 +0200 +++ linux-2.6.17.7-wapper/net/core/dev.c 2006-07-27 20:16:36.000000000 +0200 @@ -88,6 +88,7 @@ #include #include #include +#include #include #include #include @@ -1518,37 +1519,6 @@ EXPORT_SYMBOL(netif_rx_ni); -static inline struct net_device *skb_bond(struct sk_buff *skb) -{ - struct net_device *dev = skb->dev; - - if (dev->master) { - /* - * On bonding slaves other than the currently active - * slave, suppress duplicates except for 802.3ad - * ETH_P_SLOW and alb non-mcast/bcast. - */ - if (dev->priv_flags & IFF_SLAVE_INACTIVE) { - if (dev->master->priv_flags & IFF_MASTER_ALB) { - if (skb->pkt_type != PACKET_BROADCAST && - skb->pkt_type != PACKET_MULTICAST) - goto keep; - } - - if (dev->master->priv_flags & IFF_MASTER_8023AD && - skb->protocol == __constant_htons(ETH_P_SLOW)) - goto keep; - - kfree_skb(skb); - return NULL; - } -keep: - skb->dev = dev->master; - } - - return dev; -} - static void net_tx_action(struct softirq_action *h) { struct softnet_data *sd = &__get_cpu_var(softnet_data);