From owner-svn-src-all@FreeBSD.ORG Tue Dec 16 02:33:53 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 681001065673; Tue, 16 Dec 2008 02:33:53 +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 546018FC19; Tue, 16 Dec 2008 02:33:53 +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 mBG2Xrqj023876; Tue, 16 Dec 2008 02:33:53 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBG2Xr00023875; Tue, 16 Dec 2008 02:33:53 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812160233.mBG2Xr00023875@svn.freebsd.org> From: Kip Macy Date: Tue, 16 Dec 2008 02:33:53 +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: r186159 - 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:33:53 -0000 Author: kmacy Date: Tue Dec 16 02:33:53 2008 New Revision: 186159 URL: http://svn.freebsd.org/changeset/base/186159 Log: advance tail pointer in nd6_output_lle and check lla_output return against NULL Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Tue Dec 16 02:30:42 2008 (r186158) +++ head/sys/netinet6/nd6.c Tue Dec 16 02:33:53 2008 (r186159) @@ -1407,7 +1407,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru int newstate = 0; uint16_t router = 0; struct sockaddr_in6 sin6; - struct mbuf *chain = NULL; + struct mbuf *tail = NULL, *chain = NULL; int static_route = 0; IF_AFDATA_UNLOCK_ASSERT(ifp); @@ -1526,7 +1526,9 @@ nd6_cache_lladdr(struct ifnet *ifp, stru * just set the 2nd argument as the * 1st one. */ - nd6_output_lle(ifp, ifp, m_hold, L3_ADDR_SIN6(ln), NULL, ln, &chain); + nd6_output_lle(ifp, ifp, m_hold, L3_ADDR_SIN6(ln), NULL, ln, &tail); + if ((tail != NULL) && chain == (NULL)) + chain = tail; } if (chain) memcpy(&sin6, L3_ADDR_SIN6(ln), sizeof(sin6)); @@ -1889,8 +1891,10 @@ nd6_output_lle(struct ifnet *ifp, struct if (lle != NULL) { if (*tail == NULL) *tail = m; - else + else { (*tail)->m_nextpkt = m; + *tail = m; + } return (error); } if ((ifp->if_flags & IFF_LOOPBACK) != 0) { @@ -2037,7 +2041,7 @@ nd6_storelladdr(struct ifnet *ifp, struc ln = lla_lookup(LLTABLE6(ifp), 0, dst); IF_AFDATA_UNLOCK(ifp); if ((ln == NULL) || !(ln->la_flags & LLE_VALID)) { - if (ln) + if (ln != NULL) LLE_RUNLOCK(ln); /* this could happen, if we could not allocate memory */ m_freem(m);