Initalize last_updown in init_peer() so that it is reported correctly
authorclaudio <claudio@openbsd.org>
Tue, 18 Oct 2022 12:24:51 +0000 (12:24 +0000)
committerclaudio <claudio@openbsd.org>
Tue, 18 Oct 2022 12:24:51 +0000 (12:24 +0000)
for peers that never managed to establish a connection.
OK tb@

usr.sbin/bgpd/session.c

index b548455..4d92d95 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: session.c,v 1.435 2022/08/31 15:51:44 claudio Exp $ */
+/*     $OpenBSD: session.c,v 1.436 2022/10/18 12:24:51 claudio Exp $ */
 
 /*
  * Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
@@ -582,6 +582,8 @@ init_peer(struct peer *p)
        else
                timer_set(&p->timers, Timer_IdleHold, 0); /* start ASAP */
 
+       p->stats.last_updown = getmonotime();
+
        /*
         * on startup, demote if requested.
         * do not handle new peers. they must reach ESTABLISHED beforehands.