[Midnightbsd-cvs] src [9296] trunk/sys/netinet/ip_output.c: This fixes the issue with the "randomly changing" default

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Mar 2 18:22:37 EST 2017


Revision: 9296
          http://svnweb.midnightbsd.org/src/?rev=9296
Author:   laffer1
Date:     2017-03-02 18:22:37 -0500 (Thu, 02 Mar 2017)
Log Message:
-----------
This fixes the issue with the "randomly changing" default
route. What it was is there are two places in ip_output.c
where we do a goto again. One place was fine, it
copies out the new address and then resets dst = ro->rt_dst;
But the other place does *not* do that, which means earlier
when we found the gateway, we have dst pointing there
aka dst = ro->rt_gateway is done.. then we do a
goto again.. bam now we clobber the default route.

The fix is just to move the again so we are always
doing dst = &ro->rt_dst; in the again loop.

Modified Paths:
--------------
    trunk/sys/netinet/ip_output.c

Modified: trunk/sys/netinet/ip_output.c
===================================================================
--- trunk/sys/netinet/ip_output.c	2017-03-02 23:21:28 UTC (rev 9295)
+++ trunk/sys/netinet/ip_output.c	2017-03-02 23:22:37 UTC (rev 9296)
@@ -195,8 +195,8 @@
 		hlen = ip->ip_hl << 2;
 	}
 
+again:
 	dst = (struct sockaddr_in *)&ro->ro_dst;
-again:
 	ia = NULL;
 	/*
 	 * If there is a cached route,



More information about the Midnightbsd-cvs mailing list