]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: check rtt later after the real peer is known
authorTimo Teräs <timo.teras@iki.fi>
Thu, 22 Oct 2015 08:35:17 +0000 (11:35 +0300)
committervivek <vivek@cumulusnetworks.com>
Mon, 6 Jun 2016 16:29:13 +0000 (09:29 -0700)
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

bgpd/bgp_packet.c

index bf8ba199e4afd2512f1967e34cf32598bd2e3ae5..9d931da10dfba9b3a0434743e3c84713b3a0332e 100644 (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: