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

Signed-off-by: Sean Hefty <[EMAIL PROTECTED]>

---

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;



_______________________________________________
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