summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorshin <shin@FreeBSD.org>2000-03-09 14:57:16 +0000
committershin <shin@FreeBSD.org>2000-03-09 14:57:16 +0000
commit23a1d7aeede4493a8349d528992687a9a1974f0d (patch)
tree567e4b84d196c5bda0ab47a9c2833316cae0416e /sys/netinet6
parenteeb8008dd35800b119535b53dc4607fda698f4b2 (diff)
downloadFreeBSD-src-23a1d7aeede4493a8349d528992687a9a1974f0d.zip
FreeBSD-src-23a1d7aeede4493a8349d528992687a9a1974f0d.tar.gz
Initialize mbuf pointer at getting ipsec policy.
Without this, kernel will panic at getsockopt() of IPSEC_POLICY. Also make compilable libipsec/test-policy.c which tries getsockopt() of IPSEC_POLICY. Approved by: jkh Submitted by: sakane@kame.net
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ip6_output.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index fb85454..c7d0499 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1509,19 +1509,17 @@ ip6_ctloutput(so, sopt)
#ifdef IPSEC
case IPV6_IPSEC_POLICY:
{
+
+ struct mbuf *m = NULL;
caddr_t req = NULL;
- int len = 0;
- struct mbuf *m;
- struct mbuf **mp = &m;
- if (m != 0) {
+ if (m != 0)
req = mtod(m, caddr_t);
- len = m->m_len;
- }
- error = ipsec6_get_policy(in6p, req, mp);
+ error = ipsec6_get_policy(in6p, req, &m);
if (error == 0)
error = soopt_mcopyout(sopt, m); /*XXX*/
- m_freem(m);
+ if (error == 0)
+ m_freem(m);
break;
}
#endif /* IPSEC */
OpenPOWER on IntegriCloud