From owner-svn-src-all@FreeBSD.ORG Thu May 7 12:15:46 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FC69B82; Thu, 7 May 2015 12:15:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 009921D1B; Thu, 7 May 2015 12:15:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t47CFjh7087576; Thu, 7 May 2015 12:15:45 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t47CFjdf087575; Thu, 7 May 2015 12:15:45 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201505071215.t47CFjdf087575@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 7 May 2015 12:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282575 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2015 12:15:46 -0000 Author: ae Date: Thu May 7 12:15:45 2015 New Revision: 282575 URL: https://svnweb.freebsd.org/changeset/base/282575 Log: Remove unneded #ifdef INET6 and IPSEC. This file compiled only when both options are defined. Include opt_sctp.h and sctp_crc32.h to enable #ifdef SCTP code block and delayed checksum calculation for SCTP. Modified: head/sys/netinet6/ip6_ipsec.c Modified: head/sys/netinet6/ip6_ipsec.c ============================================================================== --- head/sys/netinet6/ip6_ipsec.c Thu May 7 01:55:39 2015 (r282574) +++ head/sys/netinet6/ip6_ipsec.c Thu May 7 12:15:45 2015 (r282575) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" -#include "opt_inet6.h" +#include "opt_sctp.h" #include "opt_ipsec.h" #include @@ -58,10 +58,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef SCTP +#include +#endif #include -#ifdef IPSEC #include #include #include @@ -71,16 +73,12 @@ __FBSDID("$FreeBSD$"); #else #define KEYDEBUG(lev,arg) #endif -#endif /*IPSEC*/ #include #include extern struct protosw inet6sw[]; - -#ifdef INET6 -#ifdef IPSEC #ifdef IPSEC_FILTERTUNNEL static VNET_DEFINE(int, ip6_ipsec6_filtertunnel) = 1; #else @@ -92,8 +90,6 @@ SYSCTL_DECL(_net_inet6_ipsec6); SYSCTL_INT(_net_inet6_ipsec6, OID_AUTO, filtertunnel, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_ipsec6_filtertunnel), 0, "If set filter packets from an IPsec tunnel."); -#endif /* IPSEC */ -#endif /* INET6 */ /* * Check if we have to jump over firewall processing for this packet. @@ -103,16 +99,14 @@ SYSCTL_INT(_net_inet6_ipsec6, OID_AUTO, int ip6_ipsec_filtertunnel(struct mbuf *m) { -#ifdef IPSEC /* * Bypass packet filtering for packets previously handled by IPsec. */ if (!V_ip6_ipsec6_filtertunnel && m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL) != NULL) - return 1; -#endif - return 0; + return (1); + return (0); } /* @@ -125,11 +119,7 @@ int ip6_ipsec_fwd(struct mbuf *m) { -#ifdef IPSEC return (ipsec6_in_reject(m, NULL)); -#else - return (0); -#endif /* !IPSEC */ } /* @@ -143,7 +133,6 @@ int ip6_ipsec_input(struct mbuf *m, int nxt) { -#ifdef IPSEC /* * enforce IPsec policy checking if we are seeing last header. * note that we do not visit this with protocols with pcb layer @@ -151,7 +140,6 @@ ip6_ipsec_input(struct mbuf *m, int nxt) */ if ((inet6sw[ip6_protox[nxt]].pr_flags & PR_LASTHDR) != 0) return (ipsec6_in_reject(m, NULL)); -#endif /* IPSEC */ return (0); } @@ -164,7 +152,6 @@ ip6_ipsec_input(struct mbuf *m, int nxt) int ip6_ipsec_output(struct mbuf **m, struct inpcb *inp, int *error) { -#ifdef IPSEC struct secpolicy *sp; /* @@ -257,9 +244,7 @@ reinjected: bad: if (sp != NULL) KEY_FREESP(&sp); - return 1; -#endif /* IPSEC */ - return 0; + return (1); } #if 0