Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netipsec Use time_mono_to_wall (NFC)
details: https://anonhg.NetBSD.org/src/rev/b24f212f0bd6
branches: trunk
changeset: 355054:b24f212f0bd6
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Tue Jul 11 09:49:15 2017 +0000
description:
Use time_mono_to_wall (NFC)
diffstat:
sys/netipsec/key.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diffs (42 lines):
diff -r b2a6a2bce420 -r b24f212f0bd6 sys/netipsec/key.c
--- a/sys/netipsec/key.c Tue Jul 11 08:32:17 2017 +0000
+++ b/sys/netipsec/key.c Tue Jul 11 09:49:15 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: key.c,v 1.174 2017/07/11 04:55:39 ozaki-r Exp $ */
+/* $NetBSD: key.c,v 1.175 2017/07/11 09:49:15 ozaki-r Exp $ */
/* $FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $ */
/* $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $ */
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.174 2017/07/11 04:55:39 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.175 2017/07/11 09:49:15 ozaki-r Exp $");
/*
* This code is referd to RFC 2367
@@ -2747,8 +2747,8 @@
lt->sadb_lifetime_exttype = SADB_EXT_LIFETIME_CURRENT;
lt->sadb_lifetime_allocations = 0;
lt->sadb_lifetime_bytes = 0;
- lt->sadb_lifetime_addtime = sp->created + time_second - time_uptime;
- lt->sadb_lifetime_usetime = sp->lastused + time_second - time_uptime;
+ lt->sadb_lifetime_addtime = time_mono_to_wall(sp->created);
+ lt->sadb_lifetime_usetime = time_mono_to_wall(sp->lastused);
lt = (struct sadb_lifetime *)(mtod(m, char *) + len / 2);
lt->sadb_lifetime_len = PFKEY_UNIT64(sizeof(struct sadb_lifetime));
lt->sadb_lifetime_exttype = SADB_EXT_LIFETIME_HARD;
@@ -3480,8 +3480,10 @@
continue;
l = PFKEY_UNUNIT64(((struct sadb_ext *)sav->lft_c)->sadb_ext_len);
memcpy(<, sav->lft_c, sizeof(struct sadb_lifetime));
- lt.sadb_lifetime_addtime += time_second - time_uptime;
- lt.sadb_lifetime_usetime += time_second - time_uptime;
+ lt.sadb_lifetime_addtime =
+ time_mono_to_wall(lt.sadb_lifetime_addtime);
+ lt.sadb_lifetime_usetime =
+ time_mono_to_wall(lt.sadb_lifetime_usetime);
p = <
break;
Home |
Main Index |
Thread Index |
Old Index