From owner-svn-src-head@freebsd.org Tue Oct 22 16:06:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4AB7A15E88E; Tue, 22 Oct 2019 16:06:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46yJKQ1J14z3y8s; Tue, 22 Oct 2019 16:06:34 +0000 (UTC) (envelope-from glebius@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 109E4EC9C; Tue, 22 Oct 2019 16:06:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9MG6Xp1053239; Tue, 22 Oct 2019 16:06:33 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9MG6XQB053238; Tue, 22 Oct 2019 16:06:33 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201910221606.x9MG6XQB053238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 22 Oct 2019 16:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353889 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 353889 X-SVN-Commit-Repository: base 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.29 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 Oct 2019 16:06:34 -0000 Author: glebius Date: Tue Oct 22 16:06:33 2019 New Revision: 353889 URL: https://svnweb.freebsd.org/changeset/base/353889 Log: Execute nd6_dad_timer() in the network epoch, since nd6_dad_duplicated() requires it. Make nd6_dad_starttimer() require network epoch. Two calls out of three happen from nd6_dad_timer(). Enter epoch in the remaining one. Modified: head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Tue Oct 22 15:59:16 2019 (r353888) +++ head/sys/netinet6/nd6_nbr.c Tue Oct 22 16:06:33 2019 (r353889) @@ -1192,13 +1192,10 @@ static void nd6_dad_starttimer(struct dadq *dp, int ticks, int send_ns) { - if (send_ns != 0) { - struct epoch_tracker et; + NET_EPOCH_ASSERT(); - NET_EPOCH_ENTER(et); + if (send_ns != 0) nd6_dad_ns_output(dp); - NET_EPOCH_EXIT(et); - } callout_reset(&dp->dad_timer_ch, ticks, (void (*)(void *))nd6_dad_timer, (void *)dp); } @@ -1237,6 +1234,7 @@ nd6_dad_start(struct ifaddr *ifa, int delay) struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; struct dadq *dp; char ip6buf[INET6_ADDRSTRLEN]; + struct epoch_tracker et; KASSERT((ia->ia6_flags & IN6_IFF_TENTATIVE) != 0, ("starting DAD on non-tentative address %p", ifa)); @@ -1298,7 +1296,9 @@ nd6_dad_start(struct ifaddr *ifa, int delay) /* Add this to the dadq and add a reference for the dadq. */ refcount_init(&dp->dad_refcnt, 1); nd6_dad_add(dp); + NET_EPOCH_ENTER(et); nd6_dad_starttimer(dp, delay, 0); + NET_EPOCH_EXIT(et); } /* @@ -1330,9 +1330,11 @@ nd6_dad_timer(struct dadq *dp) struct ifnet *ifp = dp->dad_ifa->ifa_ifp; struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; char ip6buf[INET6_ADDRSTRLEN]; + struct epoch_tracker et; KASSERT(ia != NULL, ("DAD entry %p with no address", dp)); + NET_EPOCH_ENTER(et); if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) { /* Do not need DAD for ifdisabled interface. */ log(LOG_ERR, "nd6_dad_timer: cancel DAD on %s because of " @@ -1429,6 +1431,7 @@ nd6_dad_timer(struct dadq *dp) err: nd6_dad_del(dp); done: + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); }