diff options
author | Robert Mustacchi <rm@joyent.com> | 2019-03-12 19:09:36 +0000 |
---|---|---|
committer | Dan McDonald <danmcd@joyent.com> | 2019-03-18 15:27:41 -0400 |
commit | 9e4af98f99ed7cc13379dff1aca68e7a3dfe29bd (patch) | |
tree | c5c339b41601172a5453c0a5fd9fe2a3f025cb4a | |
parent | edd669a7ce20a2f7406e8f00489c426c0690f1bd (diff) | |
download | illumos-joyent-9e4af98f99ed7cc13379dff1aca68e7a3dfe29bd.tar.gz |
10543 dls_unbind() needs better checking
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Ryan Zezeski <rpz@joyent.com>
Approved by: Gordon Ross <gwr@nexenta.com>
-rw-r--r-- | usr/src/uts/common/io/dls/dls.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/usr/src/uts/common/io/dls/dls.c b/usr/src/uts/common/io/dls/dls.c index 92993ada58..d6bc723371 100644 --- a/usr/src/uts/common/io/dls/dls.c +++ b/usr/src/uts/common/io/dls/dls.c @@ -25,7 +25,7 @@ */ /* - * Copyright (c) 2013 Joyent, Inc. All rights reserved. + * Copyright 2019 Joyent, Inc. */ /* @@ -218,13 +218,15 @@ dls_unbind(dld_str_t *dsp) mac_rx_bypass_enable(dsp->ds_mch); /* - * For VLAN SAP, there was a promisc handle registered when dls_bind. - * When unbind this dls link, we need to remove the promisc handle. - * See comments in dls_bind(). + * A VLAN SAP does not actually add itself to the STREAM head today. + * While we initially set up a VLAN handle below, it's possible that + * something else will have come in and clobbered it. */ - if (dsp->ds_vlan_mph != NULL) { - mac_promisc_remove(dsp->ds_vlan_mph); - dsp->ds_vlan_mph = NULL; + if (dsp->ds_sap == ETHERTYPE_VLAN) { + if (dsp->ds_vlan_mph != NULL) { + mac_promisc_remove(dsp->ds_vlan_mph); + dsp->ds_vlan_mph = NULL; + } return; } |