bgpd: check rtt later after the real peer is known

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 <timo.teras@iki.fi>
(cherry picked from commit 0edba8b6ad9c83fa0a3cc58765fe9f123f4109ac)

Conflicts:
	bgpd/bgp_packet.c
This commit is contained in:
Timo Teräs 2015-10-22 11:35:17 +03:00 committed by vivek
parent 43ed4fe5cb
commit 0cd0d97907

View File

@ -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: