]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Keep remote/local socket unions on BGP start event 14410/head
authorDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 13 Sep 2023 10:21:47 +0000 (13:21 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 13 Sep 2023 10:23:45 +0000 (13:23 +0300)
Not sure why this is needed, because it's reset on bgp_connect_success(),
when the session is UP.

When the session is reset, it clears those variables, and we are not able to
see what remote address was before, etc.

hostLocal, hostRemote reports Unknown for `show bgp neighbor json`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_fsm.c

index d4b1df175fc1d61fe5d734e6e369b91ce6841dd8..a84ddae0184b2ba867bb3ee578464a1d4d7d0c4b 100644 (file)
@@ -1826,20 +1826,6 @@ static enum bgp_fsm_state_progress bgp_start(struct peer_connection *connection)
                return BGP_FSM_FAILURE;
        }
 
-       /* Scrub some information that might be left over from a previous,
-        * session
-        */
-       /* Connection information. */
-       if (peer->su_local) {
-               sockunion_free(peer->su_local);
-               peer->su_local = NULL;
-       }
-
-       if (peer->su_remote) {
-               sockunion_free(peer->su_remote);
-               peer->su_remote = NULL;
-       }
-
        /* Clear remote router-id. */
        peer->remote_id.s_addr = INADDR_ANY;