avoid possible mbuf leaks on ipsec policy violation.(sync with kame)

This commit is contained in:
itojun 2000-06-20 02:24:42 +00:00
parent ec2eacc1f6
commit 278184a8ab

View File

@ -1,4 +1,4 @@
/* $NetBSD: ip6_output.c,v 1.22 2000/06/03 14:36:37 itojun Exp $ */ /* $NetBSD: ip6_output.c,v 1.23 2000/06/20 02:24:42 itojun Exp $ */
/* $KAME: ip6_output.c,v 1.109 2000/05/31 05:03:09 jinmei Exp $ */ /* $KAME: ip6_output.c,v 1.109 2000/05/31 05:03:09 jinmei Exp $ */
/* /*
@ -206,7 +206,7 @@ ip6_output(m0, opt, ro, flags, im6o, ifpp)
if (sp == NULL) { if (sp == NULL) {
ipsec6stat.out_inval++; ipsec6stat.out_inval++;
goto bad; goto freehdrs;
} }
error = 0; error = 0;
@ -218,7 +218,7 @@ ip6_output(m0, opt, ro, flags, im6o, ifpp)
* This packet is just discarded. * This packet is just discarded.
*/ */
ipsec6stat.out_polvio++; ipsec6stat.out_polvio++;
goto bad; goto freehdrs;
case IPSEC_POLICY_BYPASS: case IPSEC_POLICY_BYPASS:
case IPSEC_POLICY_NONE: case IPSEC_POLICY_NONE:
@ -231,7 +231,7 @@ ip6_output(m0, opt, ro, flags, im6o, ifpp)
/* XXX should be panic ? */ /* XXX should be panic ? */
printf("ip6_output: No IPsec request specified.\n"); printf("ip6_output: No IPsec request specified.\n");
error = EINVAL; error = EINVAL;
goto bad; goto freehdrs;
} }
needipsec = 1; needipsec = 1;
break; break;