patch-1.3.81 linux/net/ipv4/ip_output.c

Next file: linux/net/ipv4/route.c
Previous file: linux/net/ipv4/ip_masq_irc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.80/linux/net/ipv4/ip_output.c linux/net/ipv4/ip_output.c
@@ -239,7 +239,7 @@
 	if ((LOOPBACK(saddr) && !LOOPBACK(daddr)) || !saddr)
 		saddr = rt ? rt->rt_src : (*dev)->pa_addr;
 
-	raddr = rt ? rt->rt_gateway : 0;
+	raddr = rt ? rt->rt_gateway : daddr;
 
 	if (opt && opt->is_strictroute && rt && (rt->rt_flags & RTF_GATEWAY))
 	{
@@ -247,13 +247,6 @@
 		ip_statistics.IpOutNoRoutes++;
 		return -ENETUNREACH;
 	}
-
-	/*
-	 *	No gateway so aim at the real destination
-	 */
-
-	if (raddr == 0)
-		raddr = daddr;
 
 	/*
 	 *	Now build the MAC header.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this