diff mbox

Modify bonding hash transmit policies to use the packet's source MAC address

Message ID 20091023140845.GA24564@spaans.fox.local
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Jasper Spaans Oct. 23, 2009, 2:08 p.m. UTC
Modify bonding hash transmit policies to use the psource MAC address of
the packet instead of the MAC address configured for the bonding device.

The old sitation conflicts with the documentation.

Signed-off-by: Jasper Spaans <spaans@fox-it.com>
---
 drivers/net/bonding/bond_main.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Comments

Eric Dumazet Oct. 23, 2009, 4:02 p.m. UTC | #1
Jasper Spaans a écrit :
> Modify bonding hash transmit policies to use the psource MAC address of
> the packet instead of the MAC address configured for the bonding device.
> 
> The old sitation conflicts with the documentation.
> 
> Signed-off-by: Jasper Spaans <spaans@fox-it.com>

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jay Vosburgh Oct. 23, 2009, 4:23 p.m. UTC | #2
Jasper Spaans <spaans@fox-it.com> wrote:

>Modify bonding hash transmit policies to use the psource MAC address of
>the packet instead of the MAC address configured for the bonding device.
>
>The old sitation conflicts with the documentation.
>
>Signed-off-by: Jasper Spaans <spaans@fox-it.com>

	Looks good.

	Dave, please apply.  This may be suitable for -stable, as it's
pretty much a day one bug.

	-J

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>

>---
> drivers/net/bonding/bond_main.c |    8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 69c5b15..3f05267 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -3665,10 +3665,10 @@ static int bond_xmit_hash_policy_l23(struct sk_buff *skb,
>
> 	if (skb->protocol == htons(ETH_P_IP)) {
> 		return ((ntohl(iph->saddr ^ iph->daddr) & 0xffff) ^
>-			(data->h_dest[5] ^ bond_dev->dev_addr[5])) % count;
>+			(data->h_dest[5] ^ data->h_source[5])) % count;
> 	}
>
>-	return (data->h_dest[5] ^ bond_dev->dev_addr[5]) % count;
>+	return (data->h_dest[5] ^ data->h_source[5]) % count;
> }
>
> /*
>@@ -3695,7 +3695,7 @@ static int bond_xmit_hash_policy_l34(struct sk_buff *skb,
>
> 	}
>
>-	return (data->h_dest[5] ^ bond_dev->dev_addr[5]) % count;
>+	return (data->h_dest[5] ^ data->h_source[5]) % count;
> }
>
> /*
>@@ -3706,7 +3706,7 @@ static int bond_xmit_hash_policy_l2(struct sk_buff *skb,
> {
> 	struct ethhdr *data = (struct ethhdr *)skb->data;
>
>-	return (data->h_dest[5] ^ bond_dev->dev_addr[5]) % count;
>+	return (data->h_dest[5] ^ data->h_source[5]) % count;
> }
>
> /*-------------------------- Device entry points ----------------------------*/
>-- 
>1.6.0.4
>
>
>-- 
>Fox-IT Experts in IT Security!
>T: +31 (0) 15 284 79 99
>KvK Haaglanden 27301624
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Oct. 24, 2009, 2:02 p.m. UTC | #3
From: Jay Vosburgh <fubar@us.ibm.com>
Date: Fri, 23 Oct 2009 09:23:12 -0700

> Jasper Spaans <spaans@fox-it.com> wrote:
> 
>>Modify bonding hash transmit policies to use the psource MAC address of
>>the packet instead of the MAC address configured for the bonding device.
>>
>>The old sitation conflicts with the documentation.
>>
>>Signed-off-by: Jasper Spaans <spaans@fox-it.com>
> 
> 	Looks good.
> 
> 	Dave, please apply.  This may be suitable for -stable, as it's
> pretty much a day one bug.

Applied, and queued up for stable, thanks everyone.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 69c5b15..3f05267 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3665,10 +3665,10 @@  static int bond_xmit_hash_policy_l23(struct sk_buff *skb,
 
 	if (skb->protocol == htons(ETH_P_IP)) {
 		return ((ntohl(iph->saddr ^ iph->daddr) & 0xffff) ^
-			(data->h_dest[5] ^ bond_dev->dev_addr[5])) % count;
+			(data->h_dest[5] ^ data->h_source[5])) % count;
 	}
 
-	return (data->h_dest[5] ^ bond_dev->dev_addr[5]) % count;
+	return (data->h_dest[5] ^ data->h_source[5]) % count;
 }
 
 /*
@@ -3695,7 +3695,7 @@  static int bond_xmit_hash_policy_l34(struct sk_buff *skb,
 
 	}
 
-	return (data->h_dest[5] ^ bond_dev->dev_addr[5]) % count;
+	return (data->h_dest[5] ^ data->h_source[5]) % count;
 }
 
 /*
@@ -3706,7 +3706,7 @@  static int bond_xmit_hash_policy_l2(struct sk_buff *skb,
 {
 	struct ethhdr *data = (struct ethhdr *)skb->data;
 
-	return (data->h_dest[5] ^ bond_dev->dev_addr[5]) % count;
+	return (data->h_dest[5] ^ data->h_source[5]) % count;
 }
 
 /*-------------------------- Device entry points ----------------------------*/