summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrpokala <rpokala@FreeBSD.org>2016-01-15 04:05:56 +0000
committerrpokala <rpokala@FreeBSD.org>2016-01-15 04:05:56 +0000
commit51a93231f1eb31a7c1f6eaa0a07bf7bbf0a935cb (patch)
tree78c154d99b02e6f5abf8314f972dfa37f6e01ee1
parent21a0558e24c77a7db3038932b096194a312d61e8 (diff)
downloadFreeBSD-src-51a93231f1eb31a7c1f6eaa0a07bf7bbf0a935cb.zip
FreeBSD-src-51a93231f1eb31a7c1f6eaa0a07bf7bbf0a935cb.tar.gz
[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
-rw-r--r--sys/net/if_lagg.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index c77f244..ddb9d64 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -1058,9 +1058,25 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
/* 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
OpenPOWER on IntegriCloud