diff options
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_fsm.c | 4 | ||||
-rw-r--r-- | bgpd/bgp_network.c | 6 | ||||
-rw-r--r-- | bgpd/bgp_network.h | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 3d02214ca..3389f9afd 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -1819,8 +1819,8 @@ static void bgp_connect_in_progress_update_connection(struct peer_connection *co { struct peer *peer = connection->peer; - bgp_updatesockname(peer, connection); - if (!peer->su_remote && !BGP_CONNECTION_SU_UNSPEC(peer->connection)) { + bgp_updatesockname(connection); + if (!peer->su_remote && !BGP_CONNECTION_SU_UNSPEC(connection)) { /* if connect initiated, then dest port and dest addresses are well known */ peer->su_remote = sockunion_dup(&connection->su); if (sockunion_family(peer->su_remote) == AF_INET) diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c index f1bea1c18..35ceb9d99 100644 --- a/bgpd/bgp_network.c +++ b/bgpd/bgp_network.c @@ -861,8 +861,10 @@ enum connect_result bgp_connect(struct peer_connection *connection) htons(peer->port), ifindex); } -void bgp_updatesockname(struct peer *peer, struct peer_connection *connection) +void bgp_updatesockname(struct peer_connection *connection) { + struct peer *peer = connection->peer; + if (peer->su_local) { sockunion_free(peer->su_local); peer->su_local = NULL; @@ -882,7 +884,7 @@ int bgp_getsockname(struct peer_connection *connection) { struct peer *peer = connection->peer; - bgp_updatesockname(peer, peer->connection); + bgp_updatesockname(connection); if (!bgp_zebra_nexthop_set(peer->su_local, peer->su_remote, &peer->nexthop, peer)) { diff --git a/bgpd/bgp_network.h b/bgpd/bgp_network.h index ed1a72ec8..bd8c285f3 100644 --- a/bgpd/bgp_network.h +++ b/bgpd/bgp_network.h @@ -23,7 +23,7 @@ extern void bgp_close_vrf_socket(struct bgp *bgp); extern void bgp_close(void); extern enum connect_result bgp_connect(struct peer_connection *connection); extern int bgp_getsockname(struct peer_connection *connection); -extern void bgp_updatesockname(struct peer *peer, struct peer_connection *connection); +extern void bgp_updatesockname(struct peer_connection *connection); extern int bgp_md5_set_prefix(struct bgp *bgp, struct prefix *p, const char *password); |