Quoting r. Michael S. Tsirkin <[EMAIL PROTECTED]>:
> Subject: [PATCH] CMA: local/loopback address handling
> 
> Sean,
> Apparently, on bind, loopback addresses such as 127.0.0.1 in TCP have the same
> meaning as zeronet ANY address.
> 
> Specifically,
> getaddrinfo(NULL, port, &hints, &res);
> 
> seems to return 127.0.0.1 as interface.
> 
> The following patch makes it work for CMA as well.
> I also changed cma_loopback_addr to match any address in LOOPBACK
> subnet.
> 
> --
> 
> Interpret any ZERONET/LOOPBACK address as INADDR_ANY.
> Make cma_loopback_addr match any address in LOOPBACK subnet.
> 
> Signed-off-by: Michael S. Tsirkin <[EMAIL PROTECTED]>
> 
> Interpret any ZERONET/LOOPBACK address as INADDR_ANY.
> Make cma_loopback_addr match any address in LOOPBACK subnet.
> 
> Signed-off-by: Michael S. Tsirkin <[EMAIL PROTECTED]>

Same thing for addr.c:

---

Interpret any ZERONET/LOOPBACK address as INADDR_ANY for address resolution.

Signed-off-by: Michael S. Tsirkin <[EMAIL PROTECTED]>

Index: linux-2.6.16/drivers/infiniband/core/addr.c
===================================================================
--- linux-2.6.16/drivers/infiniband/core/addr.c (revision 6012)
+++ linux-2.6.16/drivers/infiniband/core/addr.c (working copy)
@@ -272,7 +279,7 @@ static int addr_resolve_local(struct soc
        if (!dev)
                return -EADDRNOTAVAIL;
 
-       if (!src_ip) {
+       if (ZERONET(src_ip) || LOOPBACK(src_ip)) {
                src_in->sin_family = dst_in->sin_family;
                src_in->sin_addr.s_addr = dst_ip;
                ret = copy_addr(addr, dev, dev->dev_addr);

-- 
Michael S. Tsirkin
Staff Engineer, Mellanox Technologies
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to