Skip to content

Commit

Permalink
ipfilter: Move kernel bits to netpfil
Browse files Browse the repository at this point in the history
Through fixes and improvements our ipfilter sources have diverged
enough to warrant move from contrib into sys/netpil. Now that I'm
planning on implementing MSS clamping as in iptables it makes more
sense to move ipfilter to netpfil.

This is the first of three commits the ipfilter move.

Suggested by glebius on two occaions.

Suggested by and discussed with:	glebius
Reviewed by:				glebius, kp (for #network)
Differential Revision:		https://reviews.freebsd.org/D33510

(cherry picked from commit 3b9b51f)
  • Loading branch information
cschuber committed Feb 7, 2022
1 parent de8aece commit 5729ebb
Show file tree
Hide file tree
Showing 51 changed files with 42 additions and 42 deletions.
4 changes: 2 additions & 2 deletions include/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ PCIDIR= ${INCLUDEDIR}/dev/pci
VERIEXEC= veriexec_ioctl.h
VERIEXECDIR= ${INCLUDEDIR}/dev/veriexec

.PATH: ${SRCTOP}/sys/contrib/ipfilter/netinet
.PATH: ${SRCTOP}/sys/netpfil/ipfilter/netinet
IPFILTER= ip_auth.h \
ip_compat.h \
ip_dstlist.h \
Expand Down Expand Up @@ -408,7 +408,7 @@ symlinks: .PHONY .META
.endfor
.if ${MK_IPFILTER} != "no"
cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
$$(printf '../../../%s ' sys/contrib/ipfilter/netinet/*.h) \
$$(printf '../../../%s ' sys/netpfil/ipfilter/netinet/*.h) \
${SDESTDIR}${INCLUDEDIR}/netinet;
.endif
.if ${MK_PF} != "no"
Expand Down
2 changes: 1 addition & 1 deletion sbin/ipf/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ NO_WARRAY_BOUNDS=
CFLAGS+= -I${SRCTOP}/contrib/ipfilter
CFLAGS+= -I${SRCTOP}/contrib/ipfilter/tools
CFLAGS+= -I${SRCTOP}/sys
CFLAGS+= -I${SRCTOP}/sys/contrib/ipfilter
CFLAGS+= -I${SRCTOP}/sys/netpfil/ipfilter
CFLAGS+= -DSTATETOP -D__UIO_EXPOSE

.if ${MK_INET6_SUPPORT} != "no"
Expand Down
2 changes: 1 addition & 1 deletion sbin/ipf/ipftest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ CFLAGS+= -DIPFILTER_LOG -DIPFILTER_COMPILED -DIPFILTER_LOOKUP \
# XXX CFLAGS+= -DIPFILTER_SCAN


.PATH: ${SRCTOP}/sys/contrib/ipfilter/netinet
.PATH: ${SRCTOP}/sys/netpfil/ipfilter/netinet

GENHDRS= ipnat_l.h ipnat_y.h ippool_l.h ippool_y.h ipf_l.h ipf_y.h

Expand Down
72 changes: 36 additions & 36 deletions sys/conf/files
Original file line number Diff line number Diff line change
Expand Up @@ -601,42 +601,42 @@ contrib/dev/acpica/components/utilities/utxface.c optional acpi
contrib/dev/acpica/components/utilities/utxferror.c optional acpi
contrib/dev/acpica/components/utilities/utxfinit.c optional acpi
contrib/dev/acpica/os_specific/service_layers/osgendbg.c optional acpi acpi_debug
contrib/ipfilter/netinet/fil.c optional ipfilter inet \
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_auth.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_fil_freebsd.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_frag.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_log.c optional ipfilter inet \
compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_nat.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_proxy.c optional ipfilter inet \
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_state.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_lookup.c optional ipfilter inet \
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -Wno-error -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_pool.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_htable.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter ${NO_WTAUTOLOGICAL_POINTER_COMPARE}"
contrib/ipfilter/netinet/ip_sync.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet \
compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_nat6.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_rules.c optional ipfilter inet \
compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_scan.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_dstlist.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/radix_ipf.c optional ipfilter inet \
compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
netpfil/ipfilter/netinet/fil.c optional ipfilter inet \
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/netpfil/ipfilter"
netpfil/ipfilter/netinet/ip_auth.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter"
netpfil/ipfilter/netinet/ip_fil_freebsd.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter"
netpfil/ipfilter/netinet/ip_frag.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter"
netpfil/ipfilter/netinet/ip_log.c optional ipfilter inet \
compile-with "${NORMAL_C} -I$S/netpfil/ipfilter"
netpfil/ipfilter/netinet/ip_nat.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter"
netpfil/ipfilter/netinet/ip_proxy.c optional ipfilter inet \
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/netpfil/ipfilter"
netpfil/ipfilter/netinet/ip_state.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter"
netpfil/ipfilter/netinet/ip_lookup.c optional ipfilter inet \
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -Wno-error -I$S/netpfil/ipfilter"
netpfil/ipfilter/netinet/ip_pool.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter"
netpfil/ipfilter/netinet/ip_htable.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter ${NO_WTAUTOLOGICAL_POINTER_COMPARE}"
netpfil/ipfilter/netinet/ip_sync.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter"
netpfil/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet \
compile-with "${NORMAL_C} -I$S/netpfil/ipfilter"
netpfil/ipfilter/netinet/ip_nat6.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter"
netpfil/ipfilter/netinet/ip_rules.c optional ipfilter inet \
compile-with "${NORMAL_C} -I$S/netpfil/ipfilter"
netpfil/ipfilter/netinet/ip_scan.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter"
netpfil/ipfilter/netinet/ip_dstlist.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter"
netpfil/ipfilter/netinet/radix_ipf.c optional ipfilter inet \
compile-with "${NORMAL_C} -I$S/netpfil/ipfilter"
contrib/libfdt/fdt.c optional fdt
contrib/libfdt/fdt_ro.c optional fdt
contrib/libfdt/fdt_rw.c optional fdt
Expand Down
4 changes: 2 additions & 2 deletions sys/modules/ipfilter/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# $FreeBSD$

.PATH: ${SRCTOP}/sys/contrib/ipfilter/netinet
.PATH: ${SRCTOP}/sys/netpfil/ipfilter/netinet

KMOD= ipl
SRCS= mlfk_ipl.c ip_nat.c ip_frag.c ip_state.c ip_proxy.c ip_auth.c \
Expand All @@ -9,7 +9,7 @@ SRCS= mlfk_ipl.c ip_nat.c ip_frag.c ip_state.c ip_proxy.c ip_auth.c \
ip_nat6.c ip_rules.c ip_scan.c ip_dstlist.c radix_ipf.c
SRCS+= opt_bpf.h opt_inet6.h

CFLAGS+= -I${SRCTOP}/sys/contrib/ipfilter
CFLAGS+= -I${SRCTOP}/sys/netpfil/ipfilter
CFLAGS+= -DIPFILTER=1 -DIPFILTER_LKM -DIPFILTER_LOG -DIPFILTER_LOOKUP
#
# If you don't want log functionality remove -DIPFILTER_LOG
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 5729ebb

Please sign in to comment.