]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #5513 from m-varasteh/fix-running-entry-in-vrf-change
authorRenato Westphal <renato@opensourcerouting.org>
Tue, 10 Dec 2019 13:03:01 +0000 (10:03 -0300)
committerGitHub <noreply@github.com>
Tue, 10 Dec 2019 13:03:01 +0000 (10:03 -0300)
lib: fixes invalid running_entry when VRF is changed

bgpd/bgp_fsm.c
isisd/isis_nb_config.c

index 6460ff76fe6c28bb960e94a684922ac818d4ff11..8b84d696dc45e3ea27b10aea5fa628619e6abd70 100644 (file)
@@ -164,6 +164,14 @@ static struct peer *peer_xfer_conn(struct peer *from_peer)
        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);
index 820cfaa426dc20505945bf584f06ba38104819c4..d14704b4ee18320a11ef0cfb7f77ea001edf97d8 100644 (file)
@@ -1550,9 +1550,13 @@ int lib_interface_isis_destroy(enum nb_event event,
        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;
 }