diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2019-12-31 12:02:48 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2019-12-31 12:02:48 +0000 |
commit | a2985aa5fb51f9899868daaf2cde0dfa5a0f449f (patch) | |
tree | 1acf44b6731a897114f6d5f093e76de6bb464fb1 /usr.sbin/bgpd | |
parent | b6d3f45d592ae0a8ceaea7303eb92786fc33e67a (diff) |
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.c | 9 |
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); |