Print this page
10543 dls_unbind() needs better checking
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: Dan McDonald <danmcd@joyent.com>

*** 23,33 **** * Use is subject to license terms. * Copyright 2012, Nexenta Systems, Inc. All rights reserved. */ /* ! * Copyright (c) 2013 Joyent, Inc. All rights reserved. */ /* * Data-Link Services Module */ --- 23,33 ---- * Use is subject to license terms. * Copyright 2012, Nexenta Systems, Inc. All rights reserved. */ /* ! * Copyright (c) 2019 Joyent, Inc. All rights reserved. */ /* * Data-Link Services Module */
*** 216,232 **** if (dsp->ds_nonip && --dsp->ds_dlp->dl_nonip_cnt == 0) 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(). */ if (dsp->ds_vlan_mph != NULL) { mac_promisc_remove(dsp->ds_vlan_mph); dsp->ds_vlan_mph = NULL; return; } /* * Unbind the dld_str_t by removing it from the hash table in the --- 216,234 ---- if (dsp->ds_nonip && --dsp->ds_dlp->dl_nonip_cnt == 0) mac_rx_bypass_enable(dsp->ds_mch); /* ! * 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 clobberd it. */ + 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; } /* * Unbind the dld_str_t by removing it from the hash table in the