Commit ca8d9ea3 authored by Andy Gospodarek's avatar Andy Gospodarek Committed by David S. Miller

fix bonding: allow arp_ip_targets on separate vlans to use arp validation

On Wed, Jan 06, 2010 at 10:10:03PM +0100, Eric Dumazet wrote:
> Le 06/01/2010 19:38, Eric Dumazet a écrit :
> >
> > (net-next-2.6 doesnt work well on my bond/vlan setup, I suspect I need a bisection)
>
> David, I had to revert 1f3c8804
> (bonding: allow arp_ip_targets on separate vlans to use arp validation)
>
> Or else, my vlan devices dont work (unfortunatly I dont have much time
> these days to debug the thing)
>
> My config :
>
>               +---------+
> vlan.103 -----+ bond0   +--- eth1 (bnx2)
>               |         +
> vlan.825 -----+         +--- eth2 (tg3)
>               +---------+
>
> $ cat /proc/net/bonding/bond0
> Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
>
> Bonding Mode: fault-tolerance (active-backup)
> Primary Slave: None
> Currently Active Slave: eth2
> MII Status: up
> MII Polling Interval (ms): 100
> Up Delay (ms): 0
> Down Delay (ms): 0
>
> Slave Interface: eth1  (bnx2)
> MII Status: down
> Link Failure Count: 1
> Permanent HW addr: 00:1e:0b:ec:d3:d2
>
> Slave Interface: eth2   (tg3)
> MII Status: up
> Link Failure Count: 0
> Permanent HW addr: 00:1e:0b:92:78:50
>

This patch fixes up a problem with found with commit
1f3c8804.  The original change
overloaded null_or_orig, but doing that prevented any packet handlers
that were not tied to a specific device (i.e. ptype->dev == NULL) from
ever receiving any frames.

The null_or_orig variable cannot be overloaded, and must be kept as NULL
to prevent the frame from being ignored by packet handlers designed to
accept frames on any interface.
Signed-off-by: default avatarAndy Gospodarek <andy@greyhouse.net>
Signed-off-by: default avatarJay Vosburgh <fubar@us.ibm.com>
Acked-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d160439e
...@@ -2430,6 +2430,7 @@ int netif_receive_skb(struct sk_buff *skb) ...@@ -2430,6 +2430,7 @@ int netif_receive_skb(struct sk_buff *skb)
struct packet_type *ptype, *pt_prev; struct packet_type *ptype, *pt_prev;
struct net_device *orig_dev; struct net_device *orig_dev;
struct net_device *null_or_orig; struct net_device *null_or_orig;
struct net_device *null_or_bond;
int ret = NET_RX_DROP; int ret = NET_RX_DROP;
__be16 type; __be16 type;
...@@ -2500,21 +2501,19 @@ int netif_receive_skb(struct sk_buff *skb) ...@@ -2500,21 +2501,19 @@ int netif_receive_skb(struct sk_buff *skb)
* bonding interfaces still make their way to any base bonding * bonding interfaces still make their way to any base bonding
* device that may have registered for a specific ptype. The * device that may have registered for a specific ptype. The
* handler may have to adjust skb->dev and orig_dev. * handler may have to adjust skb->dev and orig_dev.
*
* null_or_orig can be overloaded since it will not be set when
* using VLANs on top of bonding. Putting it here prevents
* disturbing the ptype_all handlers above.
*/ */
null_or_bond = NULL;
if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) && if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) &&
(vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) { (vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) {
null_or_orig = vlan_dev_real_dev(skb->dev); null_or_bond = vlan_dev_real_dev(skb->dev);
} }
type = skb->protocol; type = skb->protocol;
list_for_each_entry_rcu(ptype, list_for_each_entry_rcu(ptype,
&ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) { &ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) {
if (ptype->type == type && (ptype->dev == null_or_orig || if (ptype->type == type && (ptype->dev == null_or_orig ||
ptype->dev == skb->dev || ptype->dev == orig_dev)) { ptype->dev == skb->dev || ptype->dev == orig_dev ||
ptype->dev == null_or_bond)) {
if (pt_prev) if (pt_prev)
ret = deliver_skb(skb, pt_prev, orig_dev); ret = deliver_skb(skb, pt_prev, orig_dev);
pt_prev = ptype; pt_prev = ptype;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment