From 0cd0d97907b09efaadd9e91ff57cb4391a45fc2b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timo=20Ter=C3=A4s?= Date: Thu, 22 Oct 2015 11:35:17 +0300 Subject: [PATCH] bgpd: check rtt later after the real peer is known MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit OPEN message handler moves the connection from the temporary "struct peer" (used to accept it) to the real "struct peer" based on the configuration. RTT needs to be updated only to the real struct peer, and this patch moves the RTT query to point where realpeer is known. Fixes: ef757700d0 "bgpd: allow using rtt in route-map's set metric" Signed-off-by: Timo Teräs (cherry picked from commit 0edba8b6ad9c83fa0a3cc58765fe9f123f4109ac) Conflicts: bgpd/bgp_packet.c --- bgpd/bgp_packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index bf8ba199e4..9d931da10d 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -1177,6 +1177,7 @@ bgp_open_receive (struct peer *peer, bgp_size_t size) return -1; } } + peer->rtt = sockopt_tcp_rtt (peer->fd); if ((ret = bgp_event_update(peer, Receive_OPEN_message)) < 0) { @@ -2346,7 +2347,6 @@ bgp_read (struct thread *thread) { case BGP_MSG_OPEN: peer->open_in++; - peer->rtt = sockopt_tcp_rtt(peer->fd); bgp_open_receive (peer, size); /* XXX return value ignored! */ break; case BGP_MSG_UPDATE: -- 2.39.5