From owner-svn-src-stable@freebsd.org Fri Jan 15 04:05:57 2016 Return-Path: Delivered-To: svn-src-stable@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 86EA5A83A7D; Fri, 15 Jan 2016 04:05:57 +0000 (UTC) (envelope-from rpokala@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 5860A1286; Fri, 15 Jan 2016 04:05:57 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F45ui4071267; Fri, 15 Jan 2016 04:05:56 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F45urQ071266; Fri, 15 Jan 2016 04:05:56 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201601150405.u0F45urQ071266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Fri, 15 Jan 2016 04:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r294070 - stable/10/sys/net X-SVN-Group: stable-10 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.20 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: Fri, 15 Jan 2016 04:05:57 -0000 Author: rpokala Date: Fri Jan 15 04:05:56 2016 New Revision: 294070 URL: https://svnweb.freebsd.org/changeset/base/294070 Log: [PR 206219] Kernel panic from lagg_ioctl and lagg_port_ioctl r287723 removed some cleanup from lagg(4), which leads to panics when changing configuration. Restore the spirit of the code which was removed. This issue has been refactored out of existence in -HEAD, so this patch is directly against stable/10. PR: 206219 Submitted by: Fred Lewis < flewis @ panasas.com > Reviewed by: hiren, Daniel O'Connor < darius @ dons.net.au > Approved by: jhb Sponsored by: Panasas, Inc. Differential Revision: https://reviews.freebsd.org/D4929 Modified: stable/10/sys/net/if_lagg.c Modified: stable/10/sys/net/if_lagg.c ============================================================================== --- stable/10/sys/net/if_lagg.c Fri Jan 15 02:58:20 2016 (r294069) +++ stable/10/sys/net/if_lagg.c Fri Jan 15 04:05:56 2016 (r294070) @@ -1058,9 +1058,25 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd /* Set to LAGG_PROTO_NONE during the attach. */ LAGG_WLOCK(sc); if (sc->sc_proto != LAGG_PROTO_NONE) { + int (*sc_detach)(struct lagg_softc *sc); + + /* Reset protocol and pointers */ sc->sc_proto = LAGG_PROTO_NONE; - if (sc->sc_detach != NULL) - sc->sc_detach(sc); + sc_detach = sc->sc_detach; + sc->sc_detach = NULL; + sc->sc_start = NULL; + sc->sc_input = NULL; + sc->sc_port_create = NULL; + sc->sc_port_destroy = NULL; + sc->sc_linkstate = NULL; + sc->sc_init = NULL; + sc->sc_stop = NULL; + sc->sc_lladdr = NULL; + sc->sc_req = NULL; + sc->sc_portreq = NULL; + + if (sc_detach != NULL) + sc_detach(sc); else LAGG_WUNLOCK(sc); } else