Re: [PATCH net-next-2.6 v3] bonding: allow arp_ip_targets on separate vlans to use arp validation
From: Jay Vosburgh <hidden>
Date: 2009-12-11 05:17:23
Subsystem:
networking [general], the rest · Maintainers:
"David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds
Andy Gospodarek [off-list ref] wrote:
[...] Here is the updated patch: [PATCH net-next-2.6 v3] bonding: allow arp_ip_targets on separate vlans to use arp validation This allows a bond device to specify an arp_ip_target as a host that is not on the same vlan as the base bond device and still use arp validation. A configuration like this, now works:
[...] I'm testing with one modification to your patch (the change from your patch is below). The gist of this change is to use "null_or_orig" instead of adding a new variable "null_or_bond." I believe this is safe, as null_or_orig should currently only be set for non-VLAN traffic (VLAN traffic won't pass the "orig_dev->master" test; the VLAN code itself does the skb_bond_should_drop stuff), and the null_or_bond is/was only used for VLAN traffic. This patch has a debug printk in it right now for testing until I'm sure I'm not confused. Thoughts? -J
diff --git a/net/core/dev.c b/net/core/dev.c
index 0c96321..ac47be9 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c@@ -2422,7 +2422,6 @@ int netif_receive_skb(struct sk_buff *skb) struct packet_type *ptype, *pt_prev; struct net_device *orig_dev; struct net_device *null_or_orig; - struct net_device *null_or_bond; int ret = NET_RX_DROP; __be16 type;
@@ -2494,17 +2493,18 @@ ncls: * device that may have registered for a specific ptype. The * handler will have to adjust skb->dev and orig_dev though. */ - null_or_bond = NULL; if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) && (vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) { - null_or_bond = vlan_dev_real_dev(skb->dev); + if (null_or_orig) + printk(KERN_ERR "BAD: n_o_o %p %s\n", null_or_orig, + null_or_orig->name); + null_or_orig = vlan_dev_real_dev(skb->dev); } type = skb->protocol; list_for_each_entry_rcu(ptype, &ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) { - if (ptype->type == type && - (ptype->dev == null_or_orig || ptype->dev == null_or_bond || + if (ptype->type == type && (ptype->dev == null_or_orig || ptype->dev == skb->dev || ptype->dev == orig_dev)) { if (pt_prev) ret = deliver_skb(skb, pt_prev, orig_dev);
--- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com