[openib-general] [PATCH] [ADDR] return gateway GID for non-local IP addresses

Sean Hefty sean.hefty at intel.com
Wed Oct 12 16:39:09 PDT 2005


The following patch returns the GID of the IP gateway for non-local
subnet IP addresses.

Hal, does this change look correct to you?  I don't have an easy way
to test this fully.

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


Index: core/addr.c
===================================================================
--- core/addr.c	(revision 3707)
+++ core/addr.c	(working copy)
@@ -121,8 +121,8 @@ static void addr_send_arp(struct sockadd
 	if (ip_route_output_key(&rt, &fl))
 		return;
 
-	arp_send(ARPOP_REQUEST, ETH_P_ARP, dst_ip, rt->idev->dev, rt->rt_src,
-		 NULL, rt->idev->dev->dev_addr, NULL);
+	arp_send(ARPOP_REQUEST, ETH_P_ARP, rt->rt_gateway, rt->idev->dev,
+		 rt->rt_src, NULL, rt->idev->dev->dev_addr, NULL);
 	ip_rt_put(rt);
 }
 
@@ -144,7 +144,7 @@ static int addr_resolve_remote(struct so
 	if (ret)
 		goto out;
 
-	neigh = neigh_lookup(&arp_tbl, &dst_ip, rt->idev->dev);
+	neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, rt->idev->dev);
 	if (!neigh) {
 		ret = -ENODATA;
 		goto err1;






More information about the general mailing list