From owner-svn-src-head@freebsd.org Tue Sep 22 19:05:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 639C4A07310; Tue, 22 Sep 2015 19:05:45 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A9251D6E; Tue, 22 Sep 2015 19:05:45 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8MJ5jSk090967; Tue, 22 Sep 2015 19:05:45 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8MJ5jQ2090966; Tue, 22 Sep 2015 19:05:45 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201509221905.t8MJ5jQ2090966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Tue, 22 Sep 2015 19:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288124 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2015 19:05:45 -0000 Author: melifaro Date: Tue Sep 22 19:05:44 2015 New Revision: 288124 URL: https://svnweb.freebsd.org/changeset/base/288124 Log: Replace toe_nd6_resolve() with nd6_resolve(). Reviewed by: np Modified: head/sys/netinet/toecore.c Modified: head/sys/netinet/toecore.c ============================================================================== --- head/sys/netinet/toecore.c Tue Sep 22 18:30:06 2015 (r288123) +++ head/sys/netinet/toecore.c Tue Sep 22 19:05:44 2015 (r288124) @@ -448,77 +448,6 @@ toe_route_redirect_event(void *arg __unu return; } -#ifdef INET6 -/* - * XXX: no checks to verify that sa is really a neighbor because we assume it is - * the result of a route lookup and is on-link on the given ifp. - */ -static int -toe_nd6_resolve(struct ifnet *ifp, struct sockaddr *sa, uint8_t *lladdr) -{ - struct llentry *lle, *lle_tmp; - struct sockaddr_in6 *sin6 = (void *)sa; - int rc, flags = 0; - -restart: - IF_AFDATA_RLOCK(ifp); - lle = lla_lookup(LLTABLE6(ifp), flags, sa); - IF_AFDATA_RUNLOCK(ifp); - if (lle == NULL) { - lle = nd6_alloc(&sin6->sin6_addr, 0, ifp); - if (lle == NULL) - return (ENOMEM); /* Couldn't create entry in cache. */ - IF_AFDATA_WLOCK(ifp); - LLE_WLOCK(lle); - lle_tmp = nd6_lookup(&sin6->sin6_addr, ND6_EXCLUSIVE, ifp); - /* Prefer any existing lle over newly-created one */ - if (lle_tmp == NULL) - lltable_link_entry(LLTABLE6(ifp), lle); - IF_AFDATA_WUNLOCK(ifp); - if (lle_tmp == NULL) { - /* Arm timer for newly-created entry and send NS */ - nd6_llinfo_setstate(lle, ND6_LLINFO_INCOMPLETE); - LLE_WUNLOCK(lle); - - nd6_ns_output(ifp, NULL, NULL, &sin6->sin6_addr, 0); - - return (EWOULDBLOCK); - } else { - /* Drop newly-created lle and switch to existing one */ - lltable_free_entry(LLTABLE6(ifp), lle); - lle = lle_tmp; - lle_tmp = NULL; - } - } - - if (lle->ln_state == ND6_LLINFO_STALE) { - if ((flags & LLE_EXCLUSIVE) == 0) { - LLE_RUNLOCK(lle); - flags |= LLE_EXCLUSIVE; - goto restart; - } - - LLE_WLOCK_ASSERT(lle); - - lle->la_asked = 0; - nd6_llinfo_setstate(lle, ND6_LLINFO_DELAY); - } - - if (lle->la_flags & LLE_VALID) { - memcpy(lladdr, &lle->ll_addr, ifp->if_addrlen); - rc = 0; - } else - rc = EWOULDBLOCK; - - if (flags & LLE_EXCLUSIVE) - LLE_WUNLOCK(lle); - else - LLE_RUNLOCK(lle); - - return (rc); -} -#endif - /* * Returns 0 or EWOULDBLOCK on success (any other value is an error). 0 means * lladdr and vtag are valid on return, EWOULDBLOCK means the TOE driver's @@ -538,7 +467,7 @@ toe_l2_resolve(struct toedev *tod, struc #endif #ifdef INET6 case AF_INET6: - rc = toe_nd6_resolve(ifp, sa, lladdr); + rc = nd6_resolve(ifp, 0, NULL, sa, lladdr, NULL); break; #endif default: