summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2004-02-05 23:19:17 +0000
committersam <sam@FreeBSD.org>2004-02-05 23:19:17 +0000
commit02e3f748684e0de7afa3df5467480f2951e07993 (patch)
treecdc5f0734c4bf8b5607c823fbc8bb6c74159c85f /sys
parentac55111241f74b01b3f6f444861f24eccbd639c3 (diff)
downloadFreeBSD-src-02e3f748684e0de7afa3df5467480f2951e07993.zip
FreeBSD-src-02e3f748684e0de7afa3df5467480f2951e07993.tar.gz
must convert protocol to sa type when preparing a DELETE message
Submitted by: Roselyn Lee <rosel@verniernetworks.com> MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r--sys/netipsec/key.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c
index b8bad88..7a49007 100644
--- a/sys/netipsec/key.c
+++ b/sys/netipsec/key.c
@@ -917,12 +917,18 @@ key_do_allocsa_policy(struct secashead *sah, u_int state)
*/
if (d->lft_c->sadb_lifetime_addtime != 0) {
struct mbuf *m, *result;
+ u_int8_t satype;
key_sa_chgstate(d, SADB_SASTATE_DEAD);
IPSEC_ASSERT(d->refcnt > 0, ("bogus ref count"));
+
+ satype = key_proto2satype(d->sah->saidx.proto);
+ if (satype == 0)
+ goto msgfail;
+
m = key_setsadbmsg(SADB_DELETE, 0,
- d->sah->saidx.proto, 0, 0, d->refcnt - 1);
+ satype, 0, 0, d->refcnt - 1);
if (!m)
goto msgfail;
result = m;
OpenPOWER on IntegriCloud