summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2010-11-17 10:43:20 +0000
committerbz <bz@FreeBSD.org>2010-11-17 10:43:20 +0000
commitdc5dcc5e85273e96d3a01ad5e5e4223de176266e (patch)
treecdcdff5548a172f8711b637796086ef58863a42b
parent389cf6e63104fad1902eb97d7f7f4deba10390ac (diff)
downloadFreeBSD-src-dc5dcc5e85273e96d3a01ad5e5e4223de176266e.zip
FreeBSD-src-dc5dcc5e85273e96d3a01ad5e5e4223de176266e.tar.gz
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. MFC after: 4 days
-rw-r--r--sys/netinet6/nd6.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 0315469..f07e47f 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -836,7 +836,7 @@ nd6_lookup(struct in6_addr *addr6, int flags, struct ifnet *ifp)
{
struct sockaddr_in6 sin6;
struct llentry *ln;
- int llflags = 0;
+ int llflags;
bzero(&sin6, sizeof(sin6));
sin6.sin6_len = sizeof(struct sockaddr_in6);
@@ -845,13 +845,14 @@ nd6_lookup(struct in6_addr *addr6, int flags, struct ifnet *ifp)
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);
@@ -1451,7 +1452,7 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr,
int do_update;
int olladdr;
int llchange;
- int flags = 0;
+ int flags;
int newstate = 0;
uint16_t router = 0;
struct sockaddr_in6 sin6;
@@ -1478,13 +1479,13 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr,
* 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 {
OpenPOWER on IntegriCloud