1/* $FreeBSD: head/sys/netipsec/key.c 241686 2012-10-18 13:57:24Z andre $ */ |
2/* $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 6897 unchanged lines hidden (view full) --- 6907 * NOTE: We send only soft lifetime extension. 6908 * 6909 * OUT: 0 : succeed 6910 * others : error number 6911 */ 6912static int 6913key_expire(struct secasvar *sav) 6914{ |
6915 int satype; 6916 struct mbuf *result = NULL, *m; 6917 int len; 6918 int error = -1; 6919 struct sadb_lifetime *lt; 6920 |
6921 IPSEC_ASSERT (sav != NULL, ("null sav")); 6922 IPSEC_ASSERT (sav->sah != NULL, ("null sa header")); 6923 6924 /* set msg header */ 6925 satype = key_proto2satype(sav->sah->saidx.proto); 6926 IPSEC_ASSERT(satype != 0, ("invalid proto, satype %u", satype)); 6927 m = key_setsadbmsg(SADB_EXPIRE, 0, satype, sav->seq, 0, sav->refcnt); 6928 if (!m) { --- 85 unchanged lines hidden (view full) --- 7014 7015 result->m_pkthdr.len = 0; 7016 for (m = result; m; m = m->m_next) 7017 result->m_pkthdr.len += m->m_len; 7018 7019 mtod(result, struct sadb_msg *)->sadb_msg_len = 7020 PFKEY_UNIT64(result->m_pkthdr.len); 7021 |
7022 return key_sendup_mbuf(NULL, result, KEY_SENDUP_REGISTERED); 7023 7024 fail: 7025 if (result) 7026 m_freem(result); |
7027 return error; 7028} 7029 7030/* 7031 * SADB_FLUSH processing 7032 * receive 7033 * <base> 7034 * from the ikmpd, and free all entries in secastree. --- 1043 unchanged lines hidden --- |