If a port is removed when spanning tree was configured on it, then the
system may crash, since the STP library will try to send packets out a
now non-existent port. This commit disables STP on ports when they are
destroyed.
ofport->stp_state = state;
ofport->stp_state_entered = time_msec();
- if (fwd_change) {
+ if (fwd_change && ofport->bundle) {
bundle_update(ofport->bundle);
}
{
struct ofport *port = ofproto_get_port(ofproto, ofp_port);
if (port) {
+ if (port->ofproto->ofproto_class->set_stp_port) {
+ port->ofproto->ofproto_class->set_stp_port(port, NULL);
+ }
if (port->ofproto->ofproto_class->set_cfm) {
port->ofproto->ofproto_class->set_cfm(port, NULL);
}