From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 19:03:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 17DCD7F3; Wed, 24 Apr 2013 19:03:28 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mail.ipfw.ru (unknown [IPv6:2a01:4f8:120:6141::2]) by mx1.freebsd.org (Postfix) with ESMTP id D492F173E; Wed, 24 Apr 2013 19:03:27 +0000 (UTC) Received: from dhcp170-36-red.yandex.net ([95.108.170.36]) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1UV51n-0009dm-HD; Wed, 24 Apr 2013 23:06:51 +0400 Message-ID: <51782C4A.7050303@FreeBSD.org> Date: Wed, 24 Apr 2013 23:02:34 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130418 Thunderbird/17.0.5 MIME-Version: 1.0 To: Randall Stewart Subject: Re: svn commit: r249848 - head/sys/netinet References: <201304241830.r3OIUWiZ073002@svn.freebsd.org> In-Reply-To: <201304241830.r3OIUWiZ073002@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 19:03:28 -0000 On 24.04.2013 22:30, Randall Stewart wrote: > 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. Wow. Great job! Thanks! > > 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, >