Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Apr 2013 18:30:32 +0000 (UTC)
From:      Randall Stewart <rrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r249848 - head/sys/netinet
Message-ID:  <201304241830.r3OIUWiZ073002@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rrs
Date: Wed Apr 24 18:30:32 2013
New Revision: 249848
URL: http://svnweb.freebsd.org/changeset/base/249848

Log:
  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.
  
  PR:	 174749,157796
  MFC after:	1 week

Modified:
  head/sys/netinet/ip_output.c

Modified: head/sys/netinet/ip_output.c
==============================================================================
--- head/sys/netinet/ip_output.c	Wed Apr 24 18:00:28 2013	(r249847)
+++ head/sys/netinet/ip_output.c	Wed Apr 24 18:30:32 2013	(r249848)
@@ -196,8 +196,8 @@ ip_output(struct mbuf *m, struct mbuf *o
 		hlen = ip->ip_hl << 2;
 	}
 
-	dst = (struct sockaddr_in *)&ro->ro_dst;
 again:
+	dst = (struct sockaddr_in *)&ro->ro_dst;
 	ia = NULL;
 	/*
 	 * If there is a cached route,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304241830.r3OIUWiZ073002>