From: Donald Sharp Date: Fri, 30 Apr 2021 19:33:15 +0000 (-0400) Subject: bgpd: Add peer backpointer to `struct peer_connection` X-Git-Tag: base_9.1~138^2~9 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=84d1abd3d96c12ab19872acc224b8d11e009c849;p=matthieu%2Ffrr.git bgpd: Add peer backpointer to `struct peer_connection` We will need the peer backpointer for a `struct peer_connection` Let's add it in. Signed-off-by: Donald Sharp --- diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 8229bcb437..5a513594ca 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -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"); diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 7855d1d765..bd67c2f917 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -1121,6 +1121,8 @@ struct llgr_info { }; struct peer_connection { + struct peer *peer; + int fd; /* Packet receive and send buffer. */