From owner-svn-src-all@freebsd.org Thu Jun 2 17:17:16 2016 Return-Path: Delivered-To: svn-src-all@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 ED24FB656DD; Thu, 2 Jun 2016 17:17:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 BDED91A73; Thu, 2 Jun 2016 17:17:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52HHFct078875; Thu, 2 Jun 2016 17:17:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52HHFf3078874; Thu, 2 Jun 2016 17:17:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606021717.u52HHFf3078874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 2 Jun 2016 17:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301213 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 02 Jun 2016 17:17:17 -0000 Author: markj Date: Thu Jun 2 17:17:15 2016 New Revision: 301213 URL: https://svnweb.freebsd.org/changeset/base/301213 Log: Always start IPv6 DAD asynchronously. Otherwise we transmit the first neighbour solicitation in the context of the caller of nd6_dad_start(), which can easily result in lock recursion. When DAD is to be started after some delay, we send the first NS from the DAD callout handler, so just change the implementation to do this in the non-delayed case as well. Reviewed by: ae, hrs MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6639 Modified: head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Thu Jun 2 17:11:24 2016 (r301212) +++ head/sys/netinet6/nd6_nbr.c Thu Jun 2 17:17:15 2016 (r301213) @@ -1216,7 +1216,6 @@ nd6_dad_start(struct ifaddr *ifa, int de struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; struct dadq *dp; char ip6buf[INET6_ADDRSTRLEN]; - int send_ns; /* * If we don't need DAD, don't do it. @@ -1290,12 +1289,7 @@ nd6_dad_start(struct ifaddr *ifa, int de dp->dad_ns_lcount = dp->dad_loopbackprobe = 0; refcount_init(&dp->dad_refcnt, 1); nd6_dad_add(dp); - send_ns = 0; - if (delay == 0) { - send_ns = 1; - delay = (long)ND_IFINFO(ifa->ifa_ifp)->retrans * hz / 1000; - } - nd6_dad_starttimer(dp, delay, send_ns); + nd6_dad_starttimer(dp, delay, 0); } /*