lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1375811944-31942-6-git-send-email-vfalico@redhat.com>
Date:	Tue,  6 Aug 2013 19:59:03 +0200
From:	Veaceslav Falico <vfalico@...hat.com>
To:	netdev@...r.kernel.org
Cc:	Veaceslav Falico <vfalico@...hat.com>,
	Jay Vosburgh <fubar@...ibm.com>,
	Andy Gospodarek <andy@...yhouse.net>
Subject: [RFC PATCH net-next 5/6] bonding: convert bond_arp_send_all to use bond->dev->vlan_info

Instead of looping through bond->vlan_list, loop through
bond->dev->vlan_info via __vlan_find_dev_next_id() and dereference the
vlan_dev through __vlan_find_dev_deep(), all under rcu_read_lock().

CC: Jay Vosburgh <fubar@...ibm.com>
CC: Andy Gospodarek <andy@...yhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@...hat.com>
---
 drivers/net/bonding/bond_main.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 00f6011..b85c96f 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2447,7 +2447,6 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
 {
 	int i, vlan_id;
 	__be32 *targets = bond->params.arp_targets;
-	struct vlan_entry *vlan;
 	struct net_device *vlan_dev = NULL;
 	struct rtable *rt;
 
@@ -2492,19 +2491,18 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
 		}
 
 		vlan_id = 0;
-		list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
-			rcu_read_lock();
+		rcu_read_lock();
+		while ((vlan_id = __vlan_find_dev_next_id(bond->dev, vlan_id+1))) {
 			vlan_dev = __vlan_find_dev_deep(bond->dev,
 							htons(ETH_P_8021Q),
-							vlan->vlan_id);
-			rcu_read_unlock();
+							vlan_id);
 			if (vlan_dev == rt->dst.dev) {
-				vlan_id = vlan->vlan_id;
 				pr_debug("basa: vlan match on %s %d\n",
 				       vlan_dev->name, vlan_id);
 				break;
 			}
 		}
+		rcu_read_unlock();
 
 		if (vlan_id && vlan_dev) {
 			ip_rt_put(rt);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ