From owner-svn-src-all@FreeBSD.ORG Wed Dec 19 17:08:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 64293171; Wed, 19 Dec 2012 17:08:50 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48EB78FC0A; Wed, 19 Dec 2012 17:08:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBJH8oE6044012; Wed, 19 Dec 2012 17:08:50 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBJH8o4W044011; Wed, 19 Dec 2012 17:08:50 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201212191708.qBJH8o4W044011@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 19 Dec 2012 17:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244440 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2012 17:08:50 -0000 Author: ae Date: Wed Dec 19 17:08:49 2012 New Revision: 244440 URL: http://svnweb.freebsd.org/changeset/base/244440 Log: Make dst_sa initialization only when it is actually needed. MFC after: 1 week Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Wed Dec 19 17:02:07 2012 (r244439) +++ head/sys/netinet6/ip6_output.c Wed Dec 19 17:08:49 2012 (r244440) @@ -636,18 +636,21 @@ again: /* adjust pointer */ ip6 = mtod(m, struct ip6_hdr *); - bzero(&dst_sa, sizeof(dst_sa)); - dst_sa.sin6_family = AF_INET6; - dst_sa.sin6_len = sizeof(dst_sa); - dst_sa.sin6_addr = ip6->ip6_dst; if (ro->ro_rt) { rt = ro->ro_rt; ifp = ro->ro_rt->rt_ifp; - } else if ((error = in6_selectroute_fib(&dst_sa, opt, im6o, ro, - &ifp, &rt, inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m))) != 0) { - if (ifp != NULL) - in6_ifstat_inc(ifp, ifs6_out_discard); - goto bad; + } else { + bzero(&dst_sa, sizeof(dst_sa)); + dst_sa.sin6_family = AF_INET6; + dst_sa.sin6_len = sizeof(dst_sa); + dst_sa.sin6_addr = ip6->ip6_dst; + error = in6_selectroute_fib(&dst_sa, opt, im6o, ro, &ifp, + &rt, inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m)); + if (error != 0) { + if (ifp != NULL) + in6_ifstat_inc(ifp, ifs6_out_discard); + goto bad; + } } if (rt == NULL) { /*