From a2985aa5fb51f9899868daaf2cde0dfa5a0f449f Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Tue, 31 Dec 2019 12:02:48 +0000 Subject: 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. --- usr.sbin/bgpd/mrt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'usr.sbin') 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 @@ -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); -- cgit v1.2.3