From owner-svn-src-head@FreeBSD.ORG Tue Dec 16 01:21:20 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E645106564A; Tue, 16 Dec 2008 01:21:20 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AB418FC27; Tue, 16 Dec 2008 01:21:20 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBG1LKlt022358; Tue, 16 Dec 2008 01:21:20 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBG1LKEF022357; Tue, 16 Dec 2008 01:21:20 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200812160121.mBG1LKEF022357@svn.freebsd.org> From: Qing Li Date: Tue, 16 Dec 2008 01:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186153 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 16 Dec 2008 01:21:20 -0000 Author: qingli Date: Tue Dec 16 01:21:19 2008 New Revision: 186153 URL: http://svn.freebsd.org/changeset/base/186153 Log: Initialize the variable "router", and apply "static_route" flag across the entire nd6_cache_lladdr() function. Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Tue Dec 16 01:18:10 2008 (r186152) +++ head/sys/netinet6/nd6.c Tue Dec 16 01:21:19 2008 (r186153) @@ -1405,9 +1405,10 @@ nd6_cache_lladdr(struct ifnet *ifp, stru int llchange; int flags = 0; int newstate = 0; - uint16_t router; + uint16_t router = 0; struct sockaddr_in6 sin6; struct mbuf *chain = NULL; + int static_route = 0; IF_AFDATA_UNLOCK_ASSERT(ifp); @@ -1441,8 +1442,10 @@ nd6_cache_lladdr(struct ifnet *ifp, stru is_newentry = 1; } else { /* do nothing if static ndp is set */ - if (ln->la_flags & LLE_STATIC) + if (ln->la_flags & LLE_STATIC) { + static_route = 1; goto done; + } is_newentry = 0; } if (ln == NULL) @@ -1600,7 +1603,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru } if (ln) { - int static_route = (ln->la_flags & LLE_STATIC); + static_route = (ln->la_flags & LLE_STATIC); router = ln->ln_router; if (flags & ND6_EXCLUSIVE) @@ -1642,7 +1645,7 @@ done: LLE_WUNLOCK(ln); else LLE_RUNLOCK(ln); - if (ln->la_flags & LLE_STATIC) + if (static_route) ln = NULL; } return (ln);