svn commit: r342607 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

Cy Schubert cy at FreeBSD.org
Sun Dec 30 04:37:51 UTC 2018


Author: cy
Date: Sun Dec 30 04:37:49 2018
New Revision: 342607
URL: https://svnweb.freebsd.org/changeset/base/342607

Log:
  MFC r342377:
  
  Remove NETBSD_PF. NETBSD_PF is a flag that defines whether the pfil(9)
  framework is available. pfil(9) has been in FreeBSD since FreeBSD 5
  and according to svn log was first committed to HEAD in 2000, therefore
  it is safe to say the check is no longer needed in FreeBSD.
  
  pfil(9) first appeared in NetBSD 1.3 (hence the name NETBSD_PF).
  Therefore it is safe to say that it is supported by every NetBSD system
  today. The framework also exists in illumos.
  
  As ipfilter code is shared and exchanged between FreeBSD and NetBSD, and
  at some point in the future illumos too, and as all three platforms have
  pfil(9), the redundant NETBSD_PF #defines and #ifdefs are removed.

Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_compat.h
  stable/11/sys/contrib/ipfilter/netinet/ip_fil.h
  stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_compat.h
  stable/10/sys/contrib/ipfilter/netinet/ip_fil.h
  stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
  stable/12/sys/contrib/ipfilter/netinet/ip_compat.h
  stable/12/sys/contrib/ipfilter/netinet/ip_fil.h
  stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Directory Properties:
  stable/10/   (props changed)
  stable/12/   (props changed)

Modified: stable/11/sys/contrib/ipfilter/netinet/ip_compat.h
==============================================================================
--- stable/11/sys/contrib/ipfilter/netinet/ip_compat.h	Sun Dec 30 04:31:51 2018	(r342606)
+++ stable/11/sys/contrib/ipfilter/netinet/ip_compat.h	Sun Dec 30 04:37:49 2018	(r342607)
@@ -146,7 +146,6 @@ struct  ether_addr {
 #  define	COPYIN(a,b,c)	copyin((caddr_t)(a), (caddr_t)(b), (c))
 #  define	COPYOUT(a,b,c)	copyout((caddr_t)(a), (caddr_t)(b), (c))
 
-#   define NETBSD_PF
 # else
 #  include <inttypes.h>
 # endif /* _KERNEL */

Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil.h
==============================================================================
--- stable/11/sys/contrib/ipfilter/netinet/ip_fil.h	Sun Dec 30 04:31:51 2018	(r342606)
+++ stable/11/sys/contrib/ipfilter/netinet/ip_fil.h	Sun Dec 30 04:37:49 2018	(r342607)
@@ -1435,22 +1435,6 @@ typedef	struct	ipftune	{
 # define	CDEV_MAJOR	79
 #endif
 
-/*
- * Post NetBSD 1.2 has the PFIL interface for packet filters.  This turns
- * on those hooks.  We don't need any special mods in non-IP Filter code
- * with this!
- */
-#if (defined(NetBSD) && (NetBSD > 199609) && (NetBSD <= 1991011)) || \
-    (defined(NetBSD1_2) && NetBSD1_2 > 1) || \
-    (defined(__FreeBSD__) && (__FreeBSD_version >= 500043))
-# if (defined(NetBSD) && NetBSD >= 199905)
-#  define PFIL_HOOKS
-# endif
-# ifdef PFIL_HOOKS
-#  define NETBSD_PF
-# endif
-#endif
-
 #ifdef _KERNEL
 # define	FR_VERBOSE(verb_pr)
 # define	FR_DEBUG(verb_pr)

Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
==============================================================================
--- stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c	Sun Dec 30 04:31:51 2018	(r342606)
+++ stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c	Sun Dec 30 04:37:49 2018	(r342607)
@@ -97,9 +97,7 @@ VNET_DEFINE(ipf_main_softc_t, ipfmain) = {
 #define	V_ipfmain		VNET(ipfmain)
 
 # include <sys/conf.h>
-# if defined(NETBSD_PF)
 #  include <net/pfil.h>
-# endif /* NETBSD_PF */
 
 static eventhandler_tag ipf_arrivetag, ipf_departtag;
 #if 0
@@ -1336,14 +1334,11 @@ ipf_inject(fin, m)
 }
 
 int ipf_pfil_unhook(void) {
-#if defined(NETBSD_PF) && (__FreeBSD_version >= 500011)
 	struct pfil_head *ph_inet;
-#  ifdef USE_INET6
+#ifdef USE_INET6
 	struct pfil_head *ph_inet6;
-#  endif
 #endif
 
-#ifdef NETBSD_PF
 	ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET);
 	if (ph_inet != NULL)
 		pfil_remove_hook((void *)ipf_check_wrapper, NULL,
@@ -1354,20 +1349,16 @@ int ipf_pfil_unhook(void) {
 		pfil_remove_hook((void *)ipf_check_wrapper6, NULL,
 		    PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet6);
 # endif
-#endif
 
 	return (0);
 }
 
 int ipf_pfil_hook(void) {
-#if defined(NETBSD_PF) && (__FreeBSD_version >= 500011)
 	struct pfil_head *ph_inet;
-#  ifdef USE_INET6
+#ifdef USE_INET6
 	struct pfil_head *ph_inet6;
-#  endif
 #endif
 
-# ifdef NETBSD_PF
 	ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET);
 #    ifdef USE_INET6
 	ph_inet6 = pfil_head_get(PFIL_TYPE_AF, AF_INET6);
@@ -1388,7 +1379,6 @@ int ipf_pfil_hook(void) {
 		pfil_add_hook((void *)ipf_check_wrapper6, NULL,
 				      PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet6);
 #  endif
-# endif
 	return (0);
 }
 


More information about the svn-src-all mailing list