svn commit: r312734 - in projects/ipsec/sys: modules/ipsec netinet

Andrey V. Elsukov ae at FreeBSD.org
Wed Jan 25 03:15:03 UTC 2017


Author: ae
Date: Wed Jan 25 03:15:02 2017
New Revision: 312734
URL: https://svnweb.freebsd.org/changeset/base/312734

Log:
  Build NAT-T code only when INET support is enabled.

Modified:
  projects/ipsec/sys/modules/ipsec/Makefile
  projects/ipsec/sys/netinet/udp_usrreq.c

Modified: projects/ipsec/sys/modules/ipsec/Makefile
==============================================================================
--- projects/ipsec/sys/modules/ipsec/Makefile	Wed Jan 25 02:33:17 2017	(r312733)
+++ projects/ipsec/sys/modules/ipsec/Makefile	Wed Jan 25 03:15:02 2017	(r312734)
@@ -4,8 +4,9 @@
 
 KMOD=   ipsec
 SRCS=	if_ipsec.c ipsec.c ipsec_input.c ipsec_mbuf.c ipsec_mod.c \
-	ipsec_output.c udpencap.c xform_ah.c xform_esp.c xform_ipcomp.c \
+	ipsec_output.c xform_ah.c xform_esp.c xform_ipcomp.c \
 	opt_inet.h opt_inet6.h opt_ipsec.h opt_sctp.h 
+SRCS.INET=	udpencap.c
 
 opt_ipsec.h:
 	@echo "#define IPSEC_SUPPORT 1" > ${.TARGET}

Modified: projects/ipsec/sys/netinet/udp_usrreq.c
==============================================================================
--- projects/ipsec/sys/netinet/udp_usrreq.c	Wed Jan 25 02:33:17 2017	(r312733)
+++ projects/ipsec/sys/netinet/udp_usrreq.c	Wed Jan 25 03:15:02 2017	(r312734)
@@ -1007,6 +1007,7 @@ udp_ctloutput(struct socket *so, struct 
 	case SOPT_SET:
 		switch (sopt->sopt_name) {
 #if defined(IPSEC) || defined(IPSEC_SUPPORT)
+#ifdef INET
 		case UDP_ENCAP:
 			if (!IPSEC_ENABLED(ipv4)) {
 				INP_WUNLOCK(inp);
@@ -1014,7 +1015,8 @@ udp_ctloutput(struct socket *so, struct 
 			}
 			error = UDPENCAP_PCBCTL(inp, sopt);
 			break;
-#endif
+#endif /* INET */
+#endif /* IPSEC */
 		case UDPLITE_SEND_CSCOV:
 		case UDPLITE_RECV_CSCOV:
 			if (!isudplite) {
@@ -1052,6 +1054,7 @@ udp_ctloutput(struct socket *so, struct 
 	case SOPT_GET:
 		switch (sopt->sopt_name) {
 #if defined(IPSEC) || defined(IPSEC_SUPPORT)
+#ifdef INET
 		case UDP_ENCAP:
 			if (!IPSEC_ENABLED(ipv4)) {
 				INP_WUNLOCK(inp);
@@ -1059,7 +1062,8 @@ udp_ctloutput(struct socket *so, struct 
 			}
 			error = UDPENCAP_PCBCTL(inp, sopt);
 			break;
-#endif
+#endif /* INET */
+#endif /* IPSEC */
 		case UDPLITE_SEND_CSCOV:
 		case UDPLITE_RECV_CSCOV:
 			if (!isudplite) {


More information about the svn-src-projects mailing list