aboutsummaryrefslogtreecommitdiff
path: root/sys/netkey
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2001-01-14 17:25:08 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2001-01-14 17:25:08 +0000
commitf788b00b225832b1ab2f042f037fd312b8185590 (patch)
treeba053d3cd16dea4c848bb5b975bec3c785281e0b /sys/netkey
parent47608b56e1bdf08937e14fcfbac1c2eafe6ab6bc (diff)
Notes
Diffstat (limited to 'sys/netkey')
-rw-r--r--sys/netkey/key.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/netkey/key.c b/sys/netkey/key.c
index 8e9e356fae9f..497695aefc57 100644
--- a/sys/netkey/key.c
+++ b/sys/netkey/key.c
@@ -5513,19 +5513,16 @@ key_acquire(saidx, sp)
#ifndef IPSEC_NONBLOCK_ACQUIRE
struct secacq *newacq;
#endif
- struct secpolicyindex *spidx = NULL;
u_int8_t satype;
int error = -1;
u_int32_t seq;
/* sanity check */
- if (saidx == NULL || sp == NULL)
+ if (saidx == NULL)
panic("key_acquire: NULL pointer is passed.\n");
if ((satype = key_proto2satype(saidx->proto)) == 0)
panic("key_acquire: invalid proto is passed.\n");
- spidx = &sp->spidx;
-
#ifndef IPSEC_NONBLOCK_ACQUIRE
/*
* We never do anything about acquirng SA. There is anather
@@ -5588,12 +5585,14 @@ key_acquire(saidx, sp)
/* XXX proxy address (optional) */
/* set sadb_x_policy */
- m = key_setsadbxpolicy(sp->policy, sp->spidx.dir, sp->id);
- if (!m) {
- error = ENOBUFS;
- goto fail;
+ if (sp) {
+ m = key_setsadbxpolicy(sp->policy, sp->spidx.dir, sp->id);
+ if (!m) {
+ error = ENOBUFS;
+ goto fail;
+ }
+ m_cat(result, m);
}
- m_cat(result, m);
/* XXX identity (optional) */
#if 0