Patch from: Shmulik Hen <hshmulik@intel.com>

The following patch fixes a division by zero bug in the bonding module that
happens when transmitting through a bond with no slaves, in the XOR bonding
mode.



 drivers/net/bonding.c |    7 +++++++
 1 files changed, 7 insertions(+)

diff -puN drivers/net/bonding.c~bonding-zerodiv-fix drivers/net/bonding.c
--- 25/drivers/net/bonding.c~bonding-zerodiv-fix	2003-03-05 03:01:23.000000000 -0800
+++ 25-akpm/drivers/net/bonding.c	2003-03-05 03:01:23.000000000 -0800
@@ -2574,6 +2574,13 @@ static int bond_xmit_xor(struct sk_buff 
 		return 0;
 	}
 
+	if (bond->slave_cnt == 0) {
+		/* no slaves in the bond, frame not sent */
+		dev_kfree_skb(skb);
+		read_unlock_irqrestore(&bond->lock, flags);
+		return 0;
+	}
+	
 	slave_no = (data->h_dest[5]^slave->dev->dev_addr[5]) % bond->slave_cnt;
 
 	while ( (slave_no > 0) && (slave != (slave_t *)bond) ) {

_