aboutsummaryrefslogtreecommitdiff
path: root/sys/netipsec/key.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netipsec/key.c')
-rw-r--r--sys/netipsec/key.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c
index 2921d0235b73..dc66a397ecf5 100644
--- a/sys/netipsec/key.c
+++ b/sys/netipsec/key.c
@@ -2412,6 +2412,7 @@ key_setdumpsp(sp, type, seq, pid)
u_int32_t seq, pid;
{
struct mbuf *result = NULL, *m;
+ struct seclifetime lt;
m = key_setsadbmsg(type, 0, SADB_SATYPE_UNSPEC, seq, pid, sp->refcnt);
if (!m)
@@ -2437,6 +2438,22 @@ key_setdumpsp(sp, type, seq, pid)
goto fail;
m_cat(result, m);
+ if(sp->lifetime){
+ lt.addtime=sp->created;
+ lt.usetime= sp->lastused;
+ m = key_setlifetime(&lt, SADB_EXT_LIFETIME_CURRENT);
+ if (!m)
+ goto fail;
+ m_cat(result, m);
+
+ lt.addtime=sp->lifetime;
+ lt.usetime= sp->validtime;
+ m = key_setlifetime(&lt, SADB_EXT_LIFETIME_HARD);
+ if (!m)
+ goto fail;
+ m_cat(result, m);
+ }
+
if ((result->m_flags & M_PKTHDR) == 0)
goto fail;