]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Add peer backpointer to `struct peer_connection`
authorDonald Sharp <sharpd@nvidia.com>
Fri, 30 Apr 2021 19:33:15 +0000 (15:33 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 18 Aug 2023 13:29:04 +0000 (09:29 -0400)
We will need the peer backpointer for a `struct peer_connection`
Let's add it in.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgpd.c
bgpd/bgpd.h

index 8229bcb437825349b998416ac7ce0087a24da673..5a513594ca0b0a4b1fb073f5f2524f4e42f76de2 100644 (file)
@@ -1140,8 +1140,10 @@ static void bgp_peer_connection_free(struct peer_connection *connection)
        pthread_mutex_destroy(&connection->io_mtx);
 }
 
-static void bgp_peer_connection_new(struct peer_connection *connection)
+static void bgp_peer_connection_new(struct peer *peer,
+                                   struct peer_connection *connection)
 {
+       connection->peer = peer;
        connection->fd = -1;
 
        connection->ibuf = stream_fifo_new();
@@ -1464,7 +1466,7 @@ struct peer *peer_new(struct bgp *bgp)
        bgp_peer_gr_init(peer);
 
        /* Create buffers.  */
-       bgp_peer_connection_new(&peer->connection);
+       bgp_peer_connection_new(peer, &peer->connection);
 
        /* Get service port number.  */
        sp = getservbyname("bgp", "tcp");
index 7855d1d765fc9ad1f8b58a9278a1ca6127611d82..bd67c2f917809c89958c0988b0d410039bd55cf4 100644 (file)
@@ -1121,6 +1121,8 @@ struct llgr_info {
 };
 
 struct peer_connection {
+       struct peer *peer;
+
        int fd;
 
        /* Packet receive and send buffer. */