netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Moni Shoua <monis@voltaire.com>
To: jgarzik@pobox.com,  fubar@us.ibm.com,  rdreier@cisco.com
Cc: netdev@vger.kernel.org, general@lists.openfabrics.org
Subject: [ofa-general] [PATCH V7 2/8] IB/ipoib: Verify address handle validity on send
Date: Mon, 15 Oct 2007 18:09:52 +0200	[thread overview]
Message-ID: <471390D0.30501@voltaire.com> (raw)
In-Reply-To: <47138EB7.40703@gmail.com>


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>
---
 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 cae026c..362610d 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_bu
 				goto out;
 			}
 		} else if (neigh->ah) {
-			if (unlikely(memcmp(&neigh->dgid.raw,
+			if (unlikely((memcmp(&neigh->dgid.raw,
 					    skb->dst->neighbour->ha + 4,
-					    sizeof(union ib_gid)))) {
+					    sizeof(union ib_gid))) ||
+					 (neigh->dev != dev))) {
 				spin_lock(&priv->lock);
 				/*
 				 * It's safe to call ipoib_put_ah() inside

  parent reply	other threads:[~2007-10-15 16:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-15 16:00 [PATCH V7 0/8] net/bonding: ADD IPoIB support for the bonding driver Moni Shoua
2007-10-15 16:03 ` [ofa-general] [PATCH V7 1/8] IB/ipoib: Bound the net device to the ipoib_neigh structue Moni Shoua
2007-10-15 16:08 ` [ofa-general] [PATCH V7 0/8] net/bonding: ADD IPoIB support for the bonding driver Moni Shoua
2007-10-15 16:09 ` Moni Shoua [this message]
2007-10-15 16:10 ` [PATCH V7 3/8] net/bonding: Enable bonding to enslave non ARPHRD_ETHER Moni Shoua
2007-10-15 16:11 ` [PATCH V7 4/8] net/bonding: Enable bonding to enslave netdevices not supporting set_mac_address() Moni Shoua
2007-10-15 16:12 ` [PATCH V7 5/8] net/bonding: Enable IP multicast for bonding IPoIB devices Moni Shoua
2007-10-15 16:13 ` [PATCH V7 6/8] net/bonding: Handlle wrong assumptions that slave is always an Ethernet device Moni Shoua
2007-10-15 16:13 ` PATCH V6 7/8] net/bonding: Delay sending of gratuitous ARP to avoid failure Moni Shoua
2007-10-15 16:14 ` [PATCH V7 8/8] net/bonding: Destroy bonding master when last slave is gone Moni Shoua
2007-10-15 18:23 ` [ofa-general] Re: [PATCH V7 0/8] net/bonding: ADD IPoIB support for the bonding driver Jeff Garzik
2007-10-15 20:34   ` Jay Vosburgh
2007-10-15 20:50     ` [ofa-general] " Jeff Garzik
2007-10-15 21:53       ` Jay Vosburgh
2007-10-15 21:56         ` Jeff Garzik
2007-10-15 23:44           ` [PATCH linux-2.6] bonding: two small fixes for IPoIB support Jay Vosburgh
2007-10-16  7:56             ` Moni Shoua
2007-10-17  1:15             ` [ofa-general] " Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=471390D0.30501@voltaire.com \
    --to=monis@voltaire.com \
    --cc=fubar@us.ibm.com \
    --cc=general@lists.openfabrics.org \
    --cc=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    --cc=rdreier@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).