lib: fixes invalid running_entry when VRF is changed
bgp_writes_off(from_peer);
bgp_reads_off(from_peer);
+ /*
+ * Before exchanging FD remove doppelganger from
+ * keepalive peer hash. It could be possible conf peer
+ * fd is set to -1. If blocked on lock then keepalive
+ * thread can access peer pointer with fd -1.
+ */
+ bgp_keepalives_off(from_peer);
+
BGP_TIMER_OFF(peer->t_routeadv);
BGP_TIMER_OFF(peer->t_connect);
BGP_TIMER_OFF(peer->t_connect_check_r);
circuit = nb_running_unset_entry(dnode);
if (!circuit)
return NB_ERR_INCONSISTENCY;
- if (circuit->state == C_STATE_UP || circuit->state == C_STATE_CONF)
- isis_csm_state_change(ISIS_DISABLE, circuit, circuit->area);
+ /* disable both AFs for this circuit. this will also update the
+ * CSM state by sending an ISIS_DISABLED signal. If there is no
+ * area associated to the circuit there is nothing to do
+ */
+ if (circuit->area)
+ isis_circuit_af_set(circuit, false, false);
return NB_OK;
}