summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/nd6.c
diff options
context:
space:
mode:
authorqingli <qingli@FreeBSD.org>2008-12-16 01:21:19 +0000
committerqingli <qingli@FreeBSD.org>2008-12-16 01:21:19 +0000
commite1f9a89b0dbb799574fafc6e664d5a8ee84710b0 (patch)
treeb9a2f82a0b68bcf6946897c01a9ad1fe24c4ce52 /sys/netinet6/nd6.c
parent6e48c23840e6402634cbff6a82b98b314e221dd3 (diff)
downloadFreeBSD-src-e1f9a89b0dbb799574fafc6e664d5a8ee84710b0.zip
FreeBSD-src-e1f9a89b0dbb799574fafc6e664d5a8ee84710b0.tar.gz
Initialize the variable "router", and apply "static_route" flag
across the entire nd6_cache_lladdr() function.
Diffstat (limited to 'sys/netinet6/nd6.c')
-rw-r--r--sys/netinet6/nd6.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index bde9ebf..2d869e4 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1405,9 +1405,10 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr,
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, struct in6_addr *from, char *lladdr,
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, struct in6_addr *from, char *lladdr,
}
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);
OpenPOWER on IntegriCloud