[ewg] [PATCH resend] rdma/cma: Disallow binding rdma endpoints to 127.0.0.1.

Steve Wise swise at opengridcomputing.com
Mon Feb 8 14:04:49 PST 2010


Here is a <not tested> patch that I think removes support for binding
to 127.0.0.1.  Sean will this work?

If we agree to do this for 2.6.33, then I'll build/test this and resubmit.

----

rdma/cma: Disallow binding rdma endpoints to 127.0.0.1.

Currently this functionality breaks openmpi.  Once openmpi is fixed to
correctly ignore 127.0.0.1 as a valid external rdma address, we can
re-enable this functionality.

Signed-off-by: Steve Wise <swise at opengridcomputing.com>
---

 drivers/infiniband/core/cma.c |   16 ++--------------
 1 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index cc9b594..cd3d351 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -628,19 +628,9 @@ static inline int cma_zero_addr(struct sockaddr *addr)
 	}
 }
 
-static inline int cma_loopback_addr(struct sockaddr *addr)
-{
-	if (addr->sa_family == AF_INET)
-		return ipv4_is_loopback(
-			((struct sockaddr_in *) addr)->sin_addr.s_addr);
-	else
-		return ipv6_addr_loopback(
-			&((struct sockaddr_in6 *) addr)->sin6_addr);
-}
-
 static inline int cma_any_addr(struct sockaddr *addr)
 {
-	return cma_zero_addr(addr) || cma_loopback_addr(addr);
+	return cma_zero_addr(addr);
 }
 
 static inline __be16 cma_port(struct sockaddr *addr)
@@ -2115,9 +2105,7 @@ int rdma_bind_addr(struct rdma_cm_id *id, struct sockaddr *addr)
 	if (ret)
 		goto err1;
 
-	if (cma_loopback_addr(addr)) {
-		ret = cma_bind_loopback(id_priv);
-	} else if (!cma_zero_addr(addr)) {
+	if (!cma_zero_addr(addr)) {
 		ret = rdma_translate_ip(addr, &id->route.addr.dev_addr);
 		if (ret)
 			goto err1;




More information about the ewg mailing list