From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 02:38:48 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 942F8FAD; Sun, 27 Apr 2014 02:38:48 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E7F31FAB; Sun, 27 Apr 2014 02:38:47 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WeEzO-000IU0-7w; Sun, 27 Apr 2014 02:38:46 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s3R2chQ2013310; Sat, 26 Apr 2014 20:38:44 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+Bk4iuL6ZeZJ/e7JkseWAz Subject: Re: svn commit: r264987 - head/sys/net From: Ian Lepore To: "Alexander V. Chernikov" In-Reply-To: <535C6A3A.7030203@FreeBSD.org> References: <201404262232.s3QMW4pe085571@svn.freebsd.org> <1398554178.61646.149.camel@revolution.hippie.lan> <535C6A3A.7030203@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" Date: Sat, 26 Apr 2014 20:38:43 -0600 Message-ID: <1398566323.61646.151.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port 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.17 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: Sun, 27 Apr 2014 02:38:48 -0000 On Sun, 2014-04-27 at 06:23 +0400, Alexander V. Chernikov wrote: > On 27.04.2014 03:16, Ian Lepore wrote: > > On Sat, 2014-04-26 at 22:32 +0000, Alexander V. Chernikov wrote: > >> Author: melifaro > >> Date: Sat Apr 26 22:32:04 2014 > >> New Revision: 264987 > >> URL: http://svnweb.freebsd.org/changeset/base/264987 > >> > >> Log: > >> Determine fibnum once in the beginning of route_output(). > >> > >> MFC after: 1 month > >> > >> Modified: > >> head/sys/net/rtsock.c > > > >> Modified: head/sys/net/rtsock.c > >> ============================================================================== > >> --- head/sys/net/rtsock.c Sat Apr 26 21:03:41 2014 (r264986) > >> +++ head/sys/net/rtsock.c Sat Apr 26 22:32:04 2014 (r264987) > >> @@ -526,7 +526,7 @@ route_output(struct mbuf *m, struct sock > >> struct sockaddr_in6 *sin6; > >> int i, rti_need_deembed = 0; > >> #endif > >> - int len, error = 0; > >> + int len, error = 0, fibnum; > >> struct ifnet *ifp = NULL; > >> union sockaddr_union saun; > >> sa_family_t saf = AF_UNSPEC; > >> @@ -582,6 +582,8 @@ route_output(struct mbuf *m, struct sock > >> senderr(error); > >> } > >> > >> + fibnum = so->so_fibnum; > >> + > >> /* > >> * The given gateway address may be an interface address. > >> * For example, issuing a "route change" command on a route > >> @@ -596,7 +598,7 @@ route_output(struct mbuf *m, struct sock > >> > >> bzero(&gw_ro, sizeof(gw_ro)); > >> gw_ro.ro_dst = *info.rti_info[RTAX_GATEWAY]; > >> - rtalloc_ign_fib(&gw_ro, 0, so->so_fibnum); > >> + rtalloc_ign_fib(&gw_ro, 0, fibnum); > >> /* > >> * A host route through the loopback interface is > >> * installed for each interface adddress. In pre 8.0 > >> @@ -637,7 +639,7 @@ route_output(struct mbuf *m, struct sock > >> break; > >> } > >> error = rtrequest1_fib(rtm->rtm_type, &info, &saved_nrt, > >> - so->so_fibnum); > >> + fibnum); > >> if (error == 0 && saved_nrt != NULL) { > >> #ifdef INET6 > >> rti_need_deembed = (V_deembed_scopeid) ? 1 : 0; > >> @@ -663,8 +665,7 @@ route_output(struct mbuf *m, struct sock > >> #endif > >> break; > >> } > >> - error = rtrequest1_fib(RTM_DELETE, &info, &saved_nrt, > >> - so->so_fibnum); > >> + error = rtrequest1_fib(RTM_DELETE, &info, &saved_nrt, fibnum); > >> if (error == 0) { > >> RT_LOCK(saved_nrt); > >> rt = saved_nrt; > >> @@ -677,8 +678,7 @@ route_output(struct mbuf *m, struct sock > >> break; > >> > >> case RTM_GET: > >> - rnh = rt_tables_get_rnh(so->so_fibnum, > >> - info.rti_info[RTAX_DST]->sa_family); > >> + rnh = rt_tables_get_rnh(fibnum, saf); > >> if (rnh == NULL) > >> senderr(EAFNOSUPPORT); > >> > >> @@ -867,7 +867,7 @@ flush: > >> m_adj(m, rtm->rtm_msglen - m->m_pkthdr.len); > >> } > >> if (m) { > >> - M_SETFIB(m, so->so_fibnum); > >> + M_SETFIB(m, fibnum); > >> m->m_flags |= RTS_FILTER_FIB; > >> if (rp) { > >> /* > >> > > > > I've got build breakage that I think may be from this change... > > > > /local/build/staging/freebsd/head/src/sys/net/rtsock.c: In function 'route_output': > > /local/build/staging/freebsd/head/src/sys/net/rtsock.c:529: warning: 'fibnum' may be used uninitialized in this function > Fixed in r264998, thank you! > Twice per night is a kind of record for me :( > I'm wondering why clang hasn't seen any issue here.. > I've been doing a bunch of arm universe kernel builds that bring both clang and gcc into play; they do sometimes whine about different things. -- Ian