From owner-svn-src-stable@freebsd.org Tue May 15 09:40:53 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09A79EA8C15; Tue, 15 May 2018 09:40:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3A2D78635; Tue, 15 May 2018 09:40:52 +0000 (UTC) (envelope-from hselasky@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 949F616A7; Tue, 15 May 2018 09:40:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4F9eqoe045321; Tue, 15 May 2018 09:40:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4F9eqHV045320; Tue, 15 May 2018 09:40:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201805150940.w4F9eqHV045320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 15 May 2018 09:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333624 - stable/11/sys/netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/netinet6 X-SVN-Commit-Revision: 333624 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2018 09:40:53 -0000 Author: hselasky Date: Tue May 15 09:40:52 2018 New Revision: 333624 URL: https://svnweb.freebsd.org/changeset/base/333624 Log: MFC r333362: Fix for missing network interface address event when adding the default IPv6 based link-local address. The default link local address for IPv6 is added as part of bringing the network interface up. Move the call to "EVENTHANDLER_INVOKE(ifaddr_event,)" from the SIOCAIFADDR_IN6 ioctl(2) handler to in6_notify_ifa() which should catch all the cases of adding IPv6 based addresses to a network interface. Add a witness warning in case the event handler is not allowed to sleep. Approved by: re (marius) Reviewed by: network (ae), kib Differential Revision: https://reviews.freebsd.org/D13407 Sponsored by: Mellanox Technologies Modified: stable/11/sys/netinet6/in6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/in6.c ============================================================================== --- stable/11/sys/netinet6/in6.c Tue May 15 07:46:24 2018 (r333623) +++ stable/11/sys/netinet6/in6.c Tue May 15 09:40:52 2018 (r333624) @@ -677,7 +677,6 @@ aifaddr_out: * The failure means address duplication was detected. */ } - EVENTHANDLER_INVOKE(ifaddr_event, ifp); break; } @@ -1364,7 +1363,7 @@ in6_notify_ifa(struct ifnet *ifp, struct in6_ifaddr *i if (ifacount <= 1 && ifp->if_ioctl) { error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia); if (error) - return (error); + goto done; } /* @@ -1404,7 +1403,7 @@ in6_notify_ifa(struct ifnet *ifp, struct in6_ifaddr *i ia->ia_flags |= IFA_RTSELF; error = rtinit(&ia->ia_ifa, RTM_ADD, ia->ia_flags | rtflags); if (error) - return (error); + goto done; ia->ia_flags |= IFA_ROUTE; } @@ -1417,6 +1416,11 @@ in6_notify_ifa(struct ifnet *ifp, struct in6_ifaddr *i if (error == 0) ia->ia_flags |= IFA_RTSELF; } +done: + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "Invoking IPv6 network device address event may sleep"); + + EVENTHANDLER_INVOKE(ifaddr_event, ifp); return (error); }