summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/nd6.c
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2008-12-16 02:47:22 +0000
committerkmacy <kmacy@FreeBSD.org>2008-12-16 02:47:22 +0000
commitbf113303e635962d4c68f57b287dbfe18a3ee38e (patch)
tree184f5dd8d47f1a245ccc0f153b9c19e8eddfb51a /sys/netinet6/nd6.c
parented9ff236d567bc0c6dec9c1cb8d03b25bcc58f06 (diff)
downloadFreeBSD-src-bf113303e635962d4c68f57b287dbfe18a3ee38e.zip
FreeBSD-src-bf113303e635962d4c68f57b287dbfe18a3ee38e.tar.gz
explicitly check return of lla_lookup against NULL
Diffstat (limited to 'sys/netinet6/nd6.c')
-rw-r--r--sys/netinet6/nd6.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 898af79..fae9816 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1433,14 +1433,14 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr,
flags |= lladdr ? ND6_EXCLUSIVE : 0;
IF_AFDATA_LOCK(ifp);
ln = nd6_lookup(from, flags, ifp);
- if (ln)
- IF_AFDATA_UNLOCK(ifp);
+
if (ln == NULL) {
flags |= LLE_EXCLUSIVE;
ln = nd6_lookup(from, flags |ND6_CREATE, ifp);
IF_AFDATA_UNLOCK(ifp);
is_newentry = 1;
} else {
+ IF_AFDATA_UNLOCK(ifp);
/* do nothing if static ndp is set */
if (ln->la_flags & LLE_STATIC) {
static_route = 1;
@@ -1604,7 +1604,7 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr,
break;
}
- if (ln) {
+ if (ln != NULL) {
static_route = (ln->la_flags & LLE_STATIC);
router = ln->ln_router;
@@ -1878,7 +1878,7 @@ nd6_output_lle(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m0,
* ln is valid and the caller did not pass in
* an llentry
*/
- if (ln && (lle == NULL)) {
+ if ((ln != NULL) && (lle == NULL)) {
if (flags & LLE_EXCLUSIVE)
LLE_WUNLOCK(ln);
else
@@ -1909,7 +1909,7 @@ nd6_output_lle(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m0,
* ln is valid and the caller did not pass in
* an llentry
*/
- if (ln && (lle == NULL)) {
+ if ((ln != NULL) && (lle == NULL)) {
if (flags & LLE_EXCLUSIVE)
LLE_WUNLOCK(ln);
else
OpenPOWER on IntegriCloud