summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2019-12-31 12:02:47 +0000
committerclaudio <claudio@openbsd.org>2019-12-31 12:02:47 +0000
commit58e7a83927d00019af46bc1c7819897a4c29f5b5 (patch)
tree5b49f03d6c84665722fb62ae7dd67a502a797647 /usr.sbin/bgpd
parentreloadtime is not needed anymore. (diff)
downloadwireguard-openbsd-58e7a83927d00019af46bc1c7819897a4c29f5b5.tar.xz
wireguard-openbsd-58e7a83927d00019af46bc1c7819897a4c29f5b5.zip
In mrt_dump_hdr_rde() use clock_gettime(CLOCK_REALTIME, ) like it is done
in mrt_dump_hdr_se(). Table dumps don't need time.tv_nsec like used in the _ET formats like for message and state changes but it keeps to code similar.
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/mrt.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/mrt.c b/usr.sbin/bgpd/mrt.c
index 7426aaffa27..de4e48a21c7 100644
--- a/usr.sbin/bgpd/mrt.c
+++ b/usr.sbin/bgpd/mrt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mrt.c,v 1.100 2019/08/08 20:06:29 claudio Exp $ */
+/* $OpenBSD: mrt.c,v 1.101 2019/12/31 12:02:47 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
@@ -819,7 +819,7 @@ int
mrt_dump_hdr_rde(struct ibuf **bp, u_int16_t type, u_int16_t subtype,
u_int32_t len)
{
- time_t now;
+ struct timespec time;
if ((*bp = ibuf_dynamic(MRT_HEADER_SIZE, MRT_HEADER_SIZE +
MRT_BGP4MP_AS4_IPv6_HEADER_SIZE + MRT_BGP4MP_IPv6_ENTRY_SIZE)) ==
@@ -828,8 +828,9 @@ mrt_dump_hdr_rde(struct ibuf **bp, u_int16_t type, u_int16_t subtype,
return (-1);
}
- now = time(NULL);
- DUMP_LONG(*bp, now);
+ clock_gettime(CLOCK_REALTIME, &time);
+
+ DUMP_LONG(*bp, time.tv_sec);
DUMP_SHORT(*bp, type);
DUMP_SHORT(*bp, subtype);