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]
Date:	Mon, 2 Jun 2008 13:44:05 +0300 (IDT)
From:	Or Gerlitz <ogerlitz@...taire.com>
To:	Jay Vosburgh <fubar@...ibm.com>
cc:	Jeff Garzik <jgarzik@...ox.com>, netdev@...r.kernel.org
Subject: [RFC PATCH 2/3] net/bonding: bond_change_active_slave() cleanup
 under active-backup

simplified the code of bond_change_active_slave() such that under active-backup mode
there's one "if (new_active)" test and the rest of the code only does extra checks
on top of it. This removed an unneeded "if (bond->send_grat_arp > 0)" check and
avoid calling bond_send_gratuitous_arp when there's no active slave.

Signed-off-by: Or Gerlitz <ogerlitz@...taire.com>

---
 drivers/net/bonding/bond_main.c |   18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

Index: netdev-2.6/drivers/net/bonding/bond_main.c
===================================================================
--- netdev-2.6.orig/drivers/net/bonding/bond_main.c	2008-06-02 10:54:11.000000000 +0300
+++ netdev-2.6/drivers/net/bonding/bond_main.c	2008-06-02 11:55:32.000000000 +0300
@@ -1189,22 +1189,18 @@ void bond_change_active_slave(struct bon

 		if (new_active) {
 			bond_set_slave_active_flags(new_active);
-		}

-		if (new_active && bond->params.fail_over_mac)
-			bond_do_fail_over_mac(bond, new_active, old_active);
+			if (bond->params.fail_over_mac)
+				bond_do_fail_over_mac(bond, new_active, old_active);

-		bond->send_grat_arp = bond->params.num_grat_arp;
-		if (bond->curr_active_slave &&
-			test_bit(__LINK_STATE_LINKWATCH_PENDING,
+			bond->send_grat_arp = bond->params.num_grat_arp;
+			if (!test_bit(__LINK_STATE_LINKWATCH_PENDING,
 					&bond->curr_active_slave->dev->state)) {
-			dprintk("delaying gratuitous arp on %s\n",
-				bond->curr_active_slave->dev->name);
-		} else {
-			if (bond->send_grat_arp > 0) {
 				bond_send_gratuitous_arp(bond);
 				bond->send_grat_arp--;
-			}
+			} else
+				dprintk("delaying gratuitous arp on %s\n",
+					bond->curr_active_slave->dev->name);
 		}
 	}
 }
--
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