summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_fsm.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-09-08 18:02:05 +0200
committerDonald Sharp <sharpd@nvidia.com>2023-09-10 14:31:25 +0200
commit0c3a70c64430448c43fe12bf0ac044488352697c (patch)
treea7fd805ffc7837e50380258b639f0a921b5d79e2 /bgpd/bgp_fsm.c
parentbgpd: Convert bgp_network.c to use peer_connection (diff)
downloadfrr-0c3a70c64430448c43fe12bf0ac044488352697c.tar.xz
frr-0c3a70c64430448c43fe12bf0ac044488352697c.zip
bgpd: Move the peer->su to connection->su
The sockunion is per connection. So let's move it over. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_fsm.c')
-rw-r--r--bgpd/bgp_fsm.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index ccebe6b79..d4b1df175 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -93,9 +93,11 @@ int bgp_peer_reg_with_nht(struct peer *peer)
&& !CHECK_FLAG(peer->bgp->flags, BGP_FLAG_DISABLE_NH_CONNECTED_CHK))
connected = 1;
- return bgp_find_or_add_nexthop(
- peer->bgp, peer->bgp, family2afi(peer->su.sa.sa_family),
- SAFI_UNICAST, NULL, peer, connected, NULL);
+ return bgp_find_or_add_nexthop(peer->bgp, peer->bgp,
+ family2afi(
+ peer->connection->su.sa.sa_family),
+ SAFI_UNICAST, NULL, peer, connected,
+ NULL);
}
static void peer_xfer_stats(struct peer *peer_dst, struct peer *peer_src)
@@ -1551,7 +1553,7 @@ enum bgp_fsm_state_progress bgp_stop(struct peer_connection *connection)
peer_delete(peer);
ret = BGP_FSM_FAILURE_AND_DELETE;
} else {
- bgp_peer_conf_if_to_su_update(peer);
+ bgp_peer_conf_if_to_su_update(connection);
}
return ret;
}
@@ -1797,9 +1799,9 @@ static enum bgp_fsm_state_progress bgp_start(struct peer_connection *connection)
struct peer *peer = connection->peer;
int status;
- bgp_peer_conf_if_to_su_update(peer);
+ bgp_peer_conf_if_to_su_update(connection);
- if (peer->su.sa.sa_family == AF_UNSPEC) {
+ if (connection->su.sa.sa_family == AF_UNSPEC) {
if (bgp_debug_neighbor_events(peer))
zlog_debug(
"%s [FSM] Unable to get neighbor's IP address, waiting...",