From owner-svn-src-projects@freebsd.org Thu Dec 22 14:07:06 2016 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 135ECC8A9F5 for ; Thu, 22 Dec 2016 14:07:06 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF3EDFF0; Thu, 22 Dec 2016 14:07:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBME74ml069400; Thu, 22 Dec 2016 14:07:04 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBME74XA069399; Thu, 22 Dec 2016 14:07:04 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201612221407.uBME74XA069399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 22 Dec 2016 14:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r310405 - projects/ipsec/sys/netinet6 X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2016 14:07:06 -0000 Author: ae Date: Thu Dec 22 14:07:04 2016 New Revision: 310405 URL: https://svnweb.freebsd.org/changeset/base/310405 Log: Convert ip6_output.c to use IPsec methods. Modified: projects/ipsec/sys/netinet6/ip6_output.c Modified: projects/ipsec/sys/netinet6/ip6_output.c ============================================================================== --- projects/ipsec/sys/netinet6/ip6_output.c Thu Dec 22 14:05:25 2016 (r310404) +++ projects/ipsec/sys/netinet6/ip6_output.c Thu Dec 22 14:07:04 2016 (r310405) @@ -107,12 +107,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef IPSEC -#include -#include -#include -#include -#endif /* IPSEC */ +#include #ifdef SCTP #include #include @@ -335,14 +330,19 @@ ip6_output(struct mbuf *m0, struct ip6_p } } -#ifdef IPSEC +#if defined(IPSEC) || defined(IPSEC_SUPPORT) /* * IPSec checking which handles several cases. * FAST IPSEC: We re-injected the packet. * XXX: need scope argument. */ - if (IPSEC_OUTPUT(ipv6, m, inp, &error) != 0) - goto done; + if (IPSEC_ENABLED(ipv6)) { + if ((error = IPSEC_OUTPUT(ipv6, m, inp)) != 0) { + if (error == EINPROGRESS) + error = 0; + goto done; + } + } #endif /* IPSEC */ bzero(&exthdrs, sizeof(exthdrs)); @@ -1863,10 +1863,13 @@ do { \ INP_WUNLOCK(in6p); break; -#ifdef IPSEC +#if defined(IPSEC) || defined(IPSEC_SUPPORT) case IPV6_IPSEC_POLICY: - error = ip6_ipsec_pcbctl(in6p, sopt); - break; + if (IPSEC_ENABLED(ipv6)) { + error = IPSEC_PCBCTL(ipv6, in6p, sopt); + break; + } + /* FALLTHROUGH */ #endif /* IPSEC */ default: @@ -2091,12 +2094,14 @@ do { \ error = ip6_getmoptions(in6p, sopt); break; -#ifdef IPSEC +#if defined(IPSEC) || defined(IPSEC_SUPPORT) case IPV6_IPSEC_POLICY: - error = ip6_ipsec_pcbctl(in6p, sopt); - break; + if (IPSEC_ENABLED(ipv6)) { + error = IPSEC_PCBCTL(ipv6, in6p, sopt); + break; + } + /* FALLTHROUGH */ #endif /* IPSEC */ - default: error = ENOPROTOOPT; break;