summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/FreeBSD-2.2
diff options
context:
space:
mode:
authordarrenr <darrenr@FreeBSD.org>1997-04-03 10:22:02 +0000
committerdarrenr <darrenr@FreeBSD.org>1997-04-03 10:22:02 +0000
commitd25503500842fdd0550710a7afb953d1b8f20f00 (patch)
treef687cfed6c59d74a7c81b967eb3caf8a9c5f184e /contrib/ipfilter/FreeBSD-2.2
parent2d94e888ee6d73e6d599e49598a12d8da9f74f69 (diff)
downloadFreeBSD-src-d25503500842fdd0550710a7afb953d1b8f20f00.zip
FreeBSD-src-d25503500842fdd0550710a7afb953d1b8f20f00.tar.gz
Import IP Filter version 3.2alpha4 to bring in working LKM for 2.2
Diffstat (limited to 'contrib/ipfilter/FreeBSD-2.2')
-rw-r--r--contrib/ipfilter/FreeBSD-2.2/in_proto.c.diffs16
-rw-r--r--contrib/ipfilter/FreeBSD-2.2/ip_input.c.diffs32
-rw-r--r--contrib/ipfilter/FreeBSD-2.2/ip_output.c.diffs69
-rwxr-xr-xcontrib/ipfilter/FreeBSD-2.2/minstall38
-rwxr-xr-xcontrib/ipfilter/FreeBSD-2.2/unminstall36
5 files changed, 191 insertions, 0 deletions
diff --git a/contrib/ipfilter/FreeBSD-2.2/in_proto.c.diffs b/contrib/ipfilter/FreeBSD-2.2/in_proto.c.diffs
new file mode 100644
index 0000000..dfebbe8
--- /dev/null
+++ b/contrib/ipfilter/FreeBSD-2.2/in_proto.c.diffs
@@ -0,0 +1,16 @@
+*** in_proto.c.orig Wed Apr 2 19:50:00 1997
+--- in_proto.c Wed Apr 2 19:51:21 1997
+***************
+*** 89,94 ****
+--- 89,99 ----
+ void eoninput(), eonctlinput(), eonprotoinit();
+ #endif /* EON */
+
++ #if defined(IPFILTER) && !defined(IPFILTER_LKM)
++ void iplinit();
++ #define ip_init iplinit
++ #endif
++
+ extern struct domain inetdomain;
+
+ struct protosw inetsw[] = {
diff --git a/contrib/ipfilter/FreeBSD-2.2/ip_input.c.diffs b/contrib/ipfilter/FreeBSD-2.2/ip_input.c.diffs
new file mode 100644
index 0000000..1339e01
--- /dev/null
+++ b/contrib/ipfilter/FreeBSD-2.2/ip_input.c.diffs
@@ -0,0 +1,32 @@
+*** ip_input.c.orig Wed Apr 2 19:41:44 1997
+--- /sys/netinet/ip_input.c Wed Apr 2 19:28:53 1997
+***************
+*** 74,79 ****
+--- 74,82 ----
+ #ifdef IPFIREWALL
+ #include <netinet/ip_fw.h>
+ #endif
++ #if defined(IPFILTER_LKM) || defined(IPFILTER)
++ int (*fr_checkp) __P((struct ip *, int, struct ifnet *, int, struct mbuf **));
++ #endif
+
+ int rsvp_on = 0;
+ static int ip_rsvp_on;
+***************
+*** 310,316 ****
+--- 313,327 ----
+ * - Wrap: fake packet's addr/port <unimpl.>
+ * - Encapsulate: put it in another IP and send out. <unimp.>
+ */
++ #if defined(IPFILTER_LKM) || defined(IPFILTER)
++ if (fr_checkp) {
++ struct mbuf *m1 = m;
+
++ if ((*fr_checkp)(ip, hlen, m->m_pkthdr.rcvif, 0, &m1) || !m1)
++ return;
++ ip = mtod(m = m1, struct ip *);
++ }
++ #endif
+ #ifdef COMPAT_IPFW
+ if (ip_fw_chk_ptr) {
+ int action;
diff --git a/contrib/ipfilter/FreeBSD-2.2/ip_output.c.diffs b/contrib/ipfilter/FreeBSD-2.2/ip_output.c.diffs
new file mode 100644
index 0000000..3f53ac7
--- /dev/null
+++ b/contrib/ipfilter/FreeBSD-2.2/ip_output.c.diffs
@@ -0,0 +1,69 @@
+*** ip_output.c.orig Wed Apr 2 19:41:48 1997
+--- /sys/netinet/ip_output.c Wed Apr 2 19:38:19 1997
+***************
+*** 67,72 ****
+--- 67,76 ----
+ #else
+ #undef COMPAT_IPFW
+ #endif
++ #if defined(IPFILTER_LKM) || defined(IPFILTER)
++ extern int (*fr_checkp) __P((struct ip *, int, struct ifnet *, int, struct mbuf **));
++ #endif
++
+
+ u_short ip_id;
+
+***************
+*** 75,81 ****
+ __P((struct ifnet *, struct mbuf *, struct sockaddr_in *));
+ static int ip_getmoptions
+ __P((int, struct ip_moptions *, struct mbuf **));
+! static int ip_optcopy __P((struct ip *, struct ip *));
+ static int ip_pcbopts __P((struct mbuf **, struct mbuf *));
+ static int ip_setmoptions
+ __P((int, struct ip_moptions **, struct mbuf *));
+--- 79,85 ----
+ __P((struct ifnet *, struct mbuf *, struct sockaddr_in *));
+ static int ip_getmoptions
+ __P((int, struct ip_moptions *, struct mbuf **));
+! int ip_optcopy __P((struct ip *, struct ip *));
+ static int ip_pcbopts __P((struct mbuf **, struct mbuf *));
+ static int ip_setmoptions
+ __P((int, struct ip_moptions **, struct mbuf *));
+***************
+*** 338,344 ****
+--- 342,358 ----
+ * - Wrap: fake packet's addr/port <unimpl.>
+ * - Encapsulate: put it in another IP and send out. <unimp.>
+ */
++ #if defined(IPFILTER_LKM) || defined(IPFILTER)
++ if (fr_checkp) {
++ struct mbuf *m1 = m;
+
++ if ((*fr_checkp)(ip, hlen, ifp, 1, &m1))
++ error = EHOSTUNREACH;
++ if (error || !m1)
++ goto done;
++ ip = mtod(m = m1, struct ip *);
++ }
++ #endif
+ #ifdef COMPAT_IPFW
+ if (ip_nat_ptr && !(*ip_nat_ptr)(&ip, &m, ifp, IP_NAT_OUT)) {
+ error = EACCES;
+***************
+*** 559,565 ****
+ * Copy options from ip to jp,
+ * omitting those not copied during fragmentation.
+ */
+! static int
+ ip_optcopy(ip, jp)
+ struct ip *ip, *jp;
+ {
+--- 573,579 ----
+ * Copy options from ip to jp,
+ * omitting those not copied during fragmentation.
+ */
+! int
+ ip_optcopy(ip, jp)
+ struct ip *ip, *jp;
+ {
diff --git a/contrib/ipfilter/FreeBSD-2.2/minstall b/contrib/ipfilter/FreeBSD-2.2/minstall
new file mode 100755
index 0000000..832b68e
--- /dev/null
+++ b/contrib/ipfilter/FreeBSD-2.2/minstall
@@ -0,0 +1,38 @@
+#!/bin/csh -f
+#
+set dir=`pwd`
+set karch=`uname -m`
+if ( -d /sys/arch/$karch ) set archdir="/sys/arch/$karch"
+if ( -d /sys/$karch ) set archdir="/sys/$karch"
+set confdir="$archdir/conf"
+
+if ( $dir =~ */FreeBSD-2.2 ) cd ..
+echo "Patching ip_input.c, ip_output.c and in_proto.c"
+cat FreeBSD-2.2/ip_{in,out}put.c.diffs FreeBSD-2.2/in_proto.c.diffs | \
+(cd /sys/netinet; patch)
+
+set config=`(cd $confdir; /bin/ls -1t [0-9A-Z_]*) | head -1`
+echo -n "Kernel configuration to update [$config] "
+set newconfig=$<
+if ( "$newconfig" != "" ) then
+ set config="$confdir/$newconfig"
+else
+ set newconfig=$config
+endif
+echo "Re-config'ing $newconfig..."
+if ( -f $confdir/$newconfig ) then
+ mv $confdir/$newconfig $confdir/$newconfig.bak
+endif
+if ( -d $archdir/../compile/$newconfig ) then
+ set bak=".bak"
+ set dot=0
+ while ( -d $archdir/../compile/${newconfig}${bak} )
+ set bak=".bak."$dot
+ set dot=`expr 1 + $dot`
+ end
+ mv $archdir/../compile/$newconfig $archdir/../compile/${newconfig}$bak
+endif
+awk '{print $0;if($2=="INET"){print"options IPFILTER_LKM\noptions IPFILTER_LOG"}}' \
+ $confdir/$newconfig.bak > $confdir/$newconfig
+echo 'You will now need to run "config" and build a new kernel.'
+exit 0
diff --git a/contrib/ipfilter/FreeBSD-2.2/unminstall b/contrib/ipfilter/FreeBSD-2.2/unminstall
new file mode 100755
index 0000000..abb2631
--- /dev/null
+++ b/contrib/ipfilter/FreeBSD-2.2/unminstall
@@ -0,0 +1,36 @@
+#!/bin/csh -f
+#
+set dir=`pwd`
+set karch=`uname -m`
+if ( -d /sys/arch/$karch ) set archdir="/sys/arch/$karch"
+if ( -d /sys/$karch ) set archdir="/sys/$karch"
+set confdir="$archdir/conf"
+
+if ( $dir =~ */FreeBSD ) cd ..
+echo "Unpatching ip_input.c, ip_output.c and in_proto.c"
+cat FreeBSD/ip_{in,out}put.c.diffs FreeBSD/in_proto.c.diffs | \
+(cd /sys/netinet; patch -R)
+
+set config=`(cd $confdir; /bin/ls -1t [0-9A-Z_]*) | head -1`
+echo -n "Kernel configuration to update [$config] "
+set newconfig=$<
+if ( "$newconfig" != "" ) then
+ set config="$confdir/$newconfig"
+else
+ set newconfig=$config
+endif
+if ( -f $confdir/$newconfig ) then
+ mv $confdir/$newconfig $confdir/$newconfig.bak
+endif
+if ( -d $archdir/../compile/$newconfig ) then
+ set bak=".bak"
+ set dot=0
+ while ( -d $archdir/../compile/${newconfig}.${bak} )
+ set bak=".bak.$dot"
+ set dot=`expr 1 + $dot`
+ end
+ mv $archdir/../compile/$newconfig $archdir/../compile/${newconfig}.$bak
+endif
+grep -v IPFILTER $confdir/$newconfig.bak > $confdir/$newconfig
+echo 'You will now need to run "config" and build a new kernel.'
+exit 0
OpenPOWER on IntegriCloud