summaryrefslogtreecommitdiffstats
path: root/usr.sbin/eigrpd
diff options
context:
space:
mode:
authorrenato <renato@openbsd.org>2016-06-05 17:04:13 +0000
committerrenato <renato@openbsd.org>2016-06-05 17:04:13 +0000
commit2d38b530d298dc1297f2f9fded0700d19bb910ae (patch)
tree50a14c397e902a3b548214d1e3c3ae534be6e59d /usr.sbin/eigrpd
parentdd the cubieboard u-boot at the raw offset like the miniroot does (diff)
downloadwireguard-openbsd-2d38b530d298dc1297f2f9fded0700d19bb910ae.tar.xz
wireguard-openbsd-2d38b530d298dc1297f2f9fded0700d19bb910ae.zip
Reset the interface uptime when it is restarted.
The uptime was being set only when the interface was created, which is not what we want.
Diffstat (limited to 'usr.sbin/eigrpd')
-rw-r--r--usr.sbin/eigrpd/interface.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/eigrpd/interface.c b/usr.sbin/eigrpd/interface.c
index 5226376d993..2233e1bc41a 100644
--- a/usr.sbin/eigrpd/interface.c
+++ b/usr.sbin/eigrpd/interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interface.c,v 1.17 2016/04/15 13:21:45 renato Exp $ */
+/* $OpenBSD: interface.c,v 1.18 2016/06/05 17:04:13 renato Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
@@ -278,7 +278,6 @@ eigrp_if_new(struct eigrpd_conf *xconf, struct eigrp *eigrp, struct kif *kif)
{
struct iface *iface;
struct eigrp_iface *ei;
- struct timeval now;
iface = if_lookup(xconf, kif->ifindex);
if (iface == NULL)
@@ -297,9 +296,6 @@ eigrp_if_new(struct eigrpd_conf *xconf, struct eigrp *eigrp, struct kif *kif)
if (ei->iface->flags & IFF_LOOPBACK)
ei->passive = 1;
- gettimeofday(&now, NULL);
- ei->uptime = now.tv_sec;
-
TAILQ_INIT(&ei->nbr_list);
TAILQ_INIT(&ei->update_list);
TAILQ_INIT(&ei->query_list);
@@ -361,6 +357,7 @@ void
eigrp_if_start(struct eigrp_iface *ei)
{
struct eigrp *eigrp = ei->eigrp;
+ struct timeval now;
struct if_addr *if_addr;
union eigrpd_addr addr;
struct in_addr addr4;
@@ -369,6 +366,9 @@ eigrp_if_start(struct eigrp_iface *ei)
log_debug("%s: %s as %u family %s", __func__, ei->iface->name,
eigrp->as, af_name(eigrp->af));
+ gettimeofday(&now, NULL);
+ ei->uptime = now.tv_sec;
+
/* init the dummy self neighbor */
memset(&addr, 0, sizeof(addr));
ei->self = nbr_new(ei, &addr, 0, 1);