[openib-general] [PATCH v3] NOARP Device Support in the CMA

Sean Hefty sean.hefty at intel.com
Fri Feb 10 15:12:08 PST 2006


This is yet another updated patch that releases the reference on the acquired
route.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>

---

Index: addr.c
===================================================================
--- addr.c	(revision 5295)
+++ addr.c	(working copy)
@@ -36,6 +36,7 @@
 
 #include <linux/inetdevice.h>
 #include <linux/workqueue.h>
+#include <linux/if_arp.h>
 #include <net/arp.h>
 #include <net/neighbour.h>
 #include <net/route.h>
@@ -163,15 +164,21 @@ static int addr_resolve_remote(struct so
 	if (ret)
 		goto out;
 
+	/* If the device does ARP internally, return 'done' */
+	if (rt->idev->dev->flags & IFF_NOARP) {
+		copy_addr(addr, rt->idev->dev, NULL);
+		goto put;
+	}
+
 	neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, rt->idev->dev);
 	if (!neigh) {
 		ret = -ENODATA;
-		goto err1;
+		goto put;
 	}
 
 	if (!(neigh->nud_state & NUD_VALID)) {
 		ret = -ENODATA;
-		goto err2;
+		goto release;
 	}
 
 	if (!src_ip) {
@@ -180,9 +187,9 @@ static int addr_resolve_remote(struct so
 	}
 
 	ret = copy_addr(addr, neigh->dev, neigh->ha);
-err2:
+release:
 	neigh_release(neigh);
-err1:
+put:
 	ip_rt_put(rt);
 out:
 	return ret;






More information about the general mailing list