diff options
author | Moni Shoua <monis@voltaire.com> | 2007-10-09 22:43:37 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-15 14:20:45 -0400 |
commit | 200d1713b47200aa478f27e454e3d957264d49be (patch) | |
tree | cc7a1849ebfac45538075af5819aadfeeba4b331 /drivers/infiniband/ulp | |
parent | 732a2170f499ce7cf5f0bdd4f9e0b0c8337b67e1 (diff) |
IB/ipoib: Verify address handle validity on send
When the bonding device senses a carrier loss of its active slave it replaces
that slave with a new one. In between the times when the carrier of an IPoIB
device goes down and ipoib_neigh is destroyed, it is possible that the
bonding driver will send a packet on a new slave that uses an old ipoib_neigh.
This patch detects and prevents this from happenning.
Signed-off-by: Moni Shoua <monis at voltaire.com>
Signed-off-by: Or Gerlitz <ogerlitz at voltaire.com>
Acked-by: Roland Dreier <rdreier@cisco.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index cae026c4ebe8..362610d870e4 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -692,9 +692,10 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
692 | goto out; | 692 | goto out; |
693 | } | 693 | } |
694 | } else if (neigh->ah) { | 694 | } else if (neigh->ah) { |
695 | if (unlikely(memcmp(&neigh->dgid.raw, | 695 | if (unlikely((memcmp(&neigh->dgid.raw, |
696 | skb->dst->neighbour->ha + 4, | 696 | skb->dst->neighbour->ha + 4, |
697 | sizeof(union ib_gid)))) { | 697 | sizeof(union ib_gid))) || |
698 | (neigh->dev != dev))) { | ||
698 | spin_lock(&priv->lock); | 699 | spin_lock(&priv->lock); |
699 | /* | 700 | /* |
700 | * It's safe to call ipoib_put_ah() inside | 701 | * It's safe to call ipoib_put_ah() inside |