aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAndy Gospodarek <andy@greyhouse.net>2009-12-14 05:48:58 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-04 00:17:16 -0500
commit1f3c8804acba841b5573b953f5560d2683d2db0d (patch)
tree453fae141b4a37e72ee0513ea1816fbff8f1cf8a /net
parent3a999e6eb5d277cd6a321dcda3fc43c3d9e4e4b8 (diff)
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: BONDING_OPTS="mode=active-backup arp_interval=1000 arp_ip_target=10.0.100.1 arp_validate=3" 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 qlen 1000 link/ether 00:13:21:be:33:e9 brd ff:ff:ff:ff:ff:ff 3: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 qlen 1000 link/ether 00:13:21:be:33:e9 brd ff:ff:ff:ff:ff:ff 8: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue link/ether 00:13:21:be:33:e9 brd ff:ff:ff:ff:ff:ff inet6 fe80::213:21ff:febe:33e9/64 scope link valid_lft forever preferred_lft forever 9: bond0.100@bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue link/ether 00:13:21:be:33:e9 brd ff:ff:ff:ff:ff:ff inet 10.0.100.2/24 brd 10.0.100.255 scope global bond0.100 inet6 fe80::213:21ff:febe:33e9/64 scope link valid_lft forever preferred_lft forever Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009) Bonding Mode: fault-tolerance (active-backup) Primary Slave: None Currently Active Slave: eth1 MII Status: up MII Polling Interval (ms): 0 Up Delay (ms): 0 Down Delay (ms): 0 ARP Polling Interval (ms): 1000 ARP IP target/s (n.n.n.n form): 10.0.100.1 Slave Interface: eth1 MII Status: up Link Failure Count: 1 Permanent HW addr: 00:40:05:30:ff:30 Slave Interface: eth0 MII Status: up Link Failure Count: 0 Permanent HW addr: 00:13:21:be:33:e9 Signed-off-by: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/8021q/vlan_core.c2
-rw-r--r--net/core/dev.c20
2 files changed, 19 insertions, 3 deletions
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index e75a2f3b10af..c0316e0ca6e8 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -14,6 +14,7 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
14 if (skb_bond_should_drop(skb)) 14 if (skb_bond_should_drop(skb))
15 goto drop; 15 goto drop;
16 16
17 skb->skb_iif = skb->dev->ifindex;
17 __vlan_hwaccel_put_tag(skb, vlan_tci); 18 __vlan_hwaccel_put_tag(skb, vlan_tci);
18 skb->dev = vlan_group_get_device(grp, vlan_tci & VLAN_VID_MASK); 19 skb->dev = vlan_group_get_device(grp, vlan_tci & VLAN_VID_MASK);
19 20
@@ -85,6 +86,7 @@ vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp,
85 if (skb_bond_should_drop(skb)) 86 if (skb_bond_should_drop(skb))
86 goto drop; 87 goto drop;
87 88
89 skb->skb_iif = skb->dev->ifindex;
88 __vlan_hwaccel_put_tag(skb, vlan_tci); 90 __vlan_hwaccel_put_tag(skb, vlan_tci);
89 skb->dev = vlan_group_get_device(grp, vlan_tci & VLAN_VID_MASK); 91 skb->dev = vlan_group_get_device(grp, vlan_tci & VLAN_VID_MASK);
90 92
diff --git a/net/core/dev.c b/net/core/dev.c
index a8d68cdedbbe..f9aa699ab6cb 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2495,12 +2495,26 @@ ncls:
2495 if (!skb) 2495 if (!skb)
2496 goto out; 2496 goto out;
2497 2497
2498 /*
2499 * Make sure frames received on VLAN interfaces stacked on
2500 * bonding interfaces still make their way to any base bonding
2501 * device that may have registered for a specific ptype. The
2502 * handler may have to adjust skb->dev and orig_dev.
2503 *
2504 * null_or_orig can be overloaded since it will not be set when
2505 * using VLANs on top of bonding. Putting it here prevents
2506 * disturbing the ptype_all handlers above.
2507 */
2508 if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) &&
2509 (vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) {
2510 null_or_orig = vlan_dev_real_dev(skb->dev);
2511 }
2512
2498 type = skb->protocol; 2513 type = skb->protocol;
2499 list_for_each_entry_rcu(ptype, 2514 list_for_each_entry_rcu(ptype,
2500 &ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) { 2515 &ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) {
2501 if (ptype->type == type && 2516 if (ptype->type == type && (ptype->dev == null_or_orig ||
2502 (ptype->dev == null_or_orig || ptype->dev == skb->dev || 2517 ptype->dev == skb->dev || ptype->dev == orig_dev)) {
2503 ptype->dev == orig_dev)) {
2504 if (pt_prev) 2518 if (pt_prev)
2505 ret = deliver_skb(skb, pt_prev, orig_dev); 2519 ret = deliver_skb(skb, pt_prev, orig_dev);
2506 pt_prev = ptype; 2520 pt_prev = ptype;