1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-26 11:47:31 +00:00

Add lifetime informations to generated SPD entries when SPDDUMP

Approved by: gnn (mentor)
MFC after:	4 weeks
This commit is contained in:
VANHULLEBUS Yvan 2008-08-05 15:36:50 +00:00
parent 20ed1beeb5
commit b78813061c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=181330

View File

@ -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;