Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Nov 2010 16:31:39 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r216009 - stable/8/sys/netinet6
Message-ID:  <201011281631.oASGVdeA027691@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Sun Nov 28 16:31:39 2010
New Revision: 216009
URL: http://svn.freebsd.org/changeset/base/216009

Log:
  MFC r215423:
  
    Do not initialize flag variables before needed.
    Consistently use the LLE_ prefix for lla_lookup() and the ND6_ prefix
    for nd6_lookup() even though both are defined the same. Use the right
    flag variable when checking each.
  
    No real functional change.

Modified:
  stable/8/sys/netinet6/nd6.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/netinet6/nd6.c
==============================================================================
--- stable/8/sys/netinet6/nd6.c	Sun Nov 28 16:25:16 2010	(r216008)
+++ stable/8/sys/netinet6/nd6.c	Sun Nov 28 16:31:39 2010	(r216009)
@@ -832,7 +832,7 @@ nd6_lookup(struct in6_addr *addr6, int f
 {
 	struct sockaddr_in6 sin6;
 	struct llentry *ln;
-	int llflags = 0;
+	int llflags;
 	
 	bzero(&sin6, sizeof(sin6));
 	sin6.sin6_len = sizeof(struct sockaddr_in6);
@@ -841,13 +841,14 @@ nd6_lookup(struct in6_addr *addr6, int f
 
 	IF_AFDATA_LOCK_ASSERT(ifp);
 
+	llflags = 0;
 	if (flags & ND6_CREATE)
 	    llflags |= LLE_CREATE;
 	if (flags & ND6_EXCLUSIVE)
 	    llflags |= LLE_EXCLUSIVE;	
 	
 	ln = lla_lookup(LLTABLE6(ifp), llflags, (struct sockaddr *)&sin6);
-	if ((ln != NULL) && (flags & LLE_CREATE))
+	if ((ln != NULL) && (llflags & LLE_CREATE))
 		ln->ln_state = ND6_LLINFO_NOSTATE;
 	
 	return (ln);
@@ -1384,7 +1385,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru
 	int do_update;
 	int olladdr;
 	int llchange;
-	int flags = 0;
+	int flags;
 	int newstate = 0;
 	uint16_t router = 0;
 	struct sockaddr_in6 sin6;
@@ -1411,13 +1412,13 @@ nd6_cache_lladdr(struct ifnet *ifp, stru
 	 * Spec says nothing in sections for RA, RS and NA.  There's small
 	 * description on it in NS section (RFC 2461 7.2.3).
 	 */
-	flags |= lladdr ? ND6_EXCLUSIVE : 0;
+	flags = lladdr ? ND6_EXCLUSIVE : 0;
 	IF_AFDATA_LOCK(ifp);
 	ln = nd6_lookup(from, flags, ifp);
 
 	if (ln == NULL) {
-		flags |= LLE_EXCLUSIVE;
-		ln = nd6_lookup(from, flags |ND6_CREATE, ifp);
+		flags |= ND6_EXCLUSIVE;
+		ln = nd6_lookup(from, flags | ND6_CREATE, ifp);
 		IF_AFDATA_UNLOCK(ifp);
 		is_newentry = 1;
 	} else {



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