From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 02:47:23 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06CBB1065670; Tue, 16 Dec 2008 02:47:23 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E66E88FC1A; Tue, 16 Dec 2008 02:47:22 +0000 (UTC) (envelope-from kmacy@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 mBG2lMNK024226; Tue, 16 Dec 2008 02:47:22 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBG2lMZ2024224; Tue, 16 Dec 2008 02:47:22 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812160247.mBG2lMZ2024224@svn.freebsd.org> From: Kip Macy Date: Tue, 16 Dec 2008 02:47:22 +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: r186160 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2008 02:47:23 -0000 Author: kmacy Date: Tue Dec 16 02:47:22 2008 New Revision: 186160 URL: http://svn.freebsd.org/changeset/base/186160 Log: explicitly check return of lla_lookup against NULL Modified: head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Tue Dec 16 02:33:53 2008 (r186159) +++ head/sys/netinet6/nd6.c Tue Dec 16 02:47:22 2008 (r186160) @@ -1433,14 +1433,14 @@ nd6_cache_lladdr(struct ifnet *ifp, stru 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, stru 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 * 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 * 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 Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Tue Dec 16 02:33:53 2008 (r186159) +++ head/sys/netinet6/nd6_nbr.c Tue Dec 16 02:47:22 2008 (r186160) @@ -474,7 +474,7 @@ nd6_ns_output(struct ifnet *ifp, const s struct ip6_hdr *hip6; /* hold ip6 */ struct in6_addr *hsrc = NULL; - if (ln && ln->la_hold) { + if ((ln != NULL) && ln->la_hold) { /* * assuming every packet in la_hold has the same IP * header @@ -878,7 +878,7 @@ nd6_na_input(struct mbuf *m, int off, in } } freeit: - if (ln) { + if (ln != NULL) { if (chain) memcpy(&sin6, L3_ADDR_SIN6(ln), sizeof(sin6)); LLE_WUNLOCK(ln); @@ -890,7 +890,7 @@ nd6_na_input(struct mbuf *m, int off, in return; bad: - if (ln) + if (ln != NULL) LLE_WUNLOCK(ln); V_icmp6stat.icp6s_badna++;