diff options
author | darrenr <darrenr@FreeBSD.org> | 1997-05-25 15:45:04 +0000 |
---|---|---|
committer | darrenr <darrenr@FreeBSD.org> | 1997-05-25 15:45:04 +0000 |
commit | e0610b5498ab54082ddadbfebd47280245e3e0f8 (patch) | |
tree | f9876809ef0dd75bd4671d4afb7d3488f1972a5f /contrib/ipfilter/FreeBSD-2.2 | |
parent | d25503500842fdd0550710a7afb953d1b8f20f00 (diff) | |
download | FreeBSD-src-e0610b5498ab54082ddadbfebd47280245e3e0f8.zip FreeBSD-src-e0610b5498ab54082ddadbfebd47280245e3e0f8.tar.gz |
Import version 3.2alpha7
Diffstat (limited to 'contrib/ipfilter/FreeBSD-2.2')
-rw-r--r-- | contrib/ipfilter/FreeBSD-2.2/files.diffs | 18 | ||||
-rw-r--r-- | contrib/ipfilter/FreeBSD-2.2/files.newconf.diffs | 16 | ||||
-rw-r--r-- | contrib/ipfilter/FreeBSD-2.2/in_proto.c.diffs | 4 | ||||
-rw-r--r-- | contrib/ipfilter/FreeBSD-2.2/ip_input.c.diffs | 10 | ||||
-rw-r--r-- | contrib/ipfilter/FreeBSD-2.2/ip_output.c.diffs | 16 | ||||
-rwxr-xr-x | contrib/ipfilter/FreeBSD-2.2/kinstall | 61 | ||||
-rwxr-xr-x | contrib/ipfilter/FreeBSD-2.2/unkinstall | 55 | ||||
-rwxr-xr-x | contrib/ipfilter/FreeBSD-2.2/unminstall | 4 |
8 files changed, 167 insertions, 17 deletions
diff --git a/contrib/ipfilter/FreeBSD-2.2/files.diffs b/contrib/ipfilter/FreeBSD-2.2/files.diffs new file mode 100644 index 0000000..8bd40ac --- /dev/null +++ b/contrib/ipfilter/FreeBSD-2.2/files.diffs @@ -0,0 +1,18 @@ +*** /sys/conf/files.orig Sat May 24 14:05:28 1997 +--- /sys/conf/files Sat May 24 14:06:44 1997 +*************** +*** 217,222 **** +--- 217,228 ---- + netinet/tcp_timer.c optional inet + netinet/tcp_usrreq.c optional inet + netinet/udp_usrreq.c optional inet ++ netinet/ip_fil.c optional ipfilter inet ++ netinet/fil.c optional ipfilter inet ++ netinet/ip_nat.c optional ipfilter inet ++ netinet/ip_frag.c optional ipfilter inet ++ netinet/ip_state.c optional ipfilter inet ++ netinet/ip_proxy.c optional ipfilter inet ++ netinet/mlf_ipl.c optional ipfilter inet + netipx/ipx.c optional ipx + netipx/ipx_cksum.c optional ipx + netipx/ipx_error.c optional ipx diff --git a/contrib/ipfilter/FreeBSD-2.2/files.newconf.diffs b/contrib/ipfilter/FreeBSD-2.2/files.newconf.diffs new file mode 100644 index 0000000..784ef5d --- /dev/null +++ b/contrib/ipfilter/FreeBSD-2.2/files.newconf.diffs @@ -0,0 +1,16 @@ +*** files.newconf.orig Sun Jun 25 02:17:29 1995 +--- files.newconf Sun Jun 25 02:19:10 1995 +*************** +*** 161,166 **** +--- 161,171 ---- + file netinet/ip_input.c inet + file netinet/ip_mroute.c inet + file netinet/ip_output.c inet ++ file netinet/ip_fil.c ipfilter ++ file netinet/fil.c ipfilter ++ file netinet/ip_nat.c ipfilter ++ file netinet/ip_frag.c ipfilter ++ file netinet/ip_state.c ipfilter + file netinet/raw_ip.c inet + file netinet/tcp_debug.c inet + file netinet/tcp_input.c inet diff --git a/contrib/ipfilter/FreeBSD-2.2/in_proto.c.diffs b/contrib/ipfilter/FreeBSD-2.2/in_proto.c.diffs index dfebbe8..c2822d3 100644 --- a/contrib/ipfilter/FreeBSD-2.2/in_proto.c.diffs +++ b/contrib/ipfilter/FreeBSD-2.2/in_proto.c.diffs @@ -1,5 +1,5 @@ -*** in_proto.c.orig Wed Apr 2 19:50:00 1997 ---- in_proto.c Wed Apr 2 19:51:21 1997 +*** /sys/netinet/in_proto.c.orig Sat May 24 13:42:26 1997 +--- /sys/netinet/in_proto.c Sat May 24 13:42:36 1997 *************** *** 89,94 **** --- 89,99 ---- diff --git a/contrib/ipfilter/FreeBSD-2.2/ip_input.c.diffs b/contrib/ipfilter/FreeBSD-2.2/ip_input.c.diffs index 1339e01..c2b2b15 100644 --- a/contrib/ipfilter/FreeBSD-2.2/ip_input.c.diffs +++ b/contrib/ipfilter/FreeBSD-2.2/ip_input.c.diffs @@ -1,5 +1,5 @@ -*** ip_input.c.orig Wed Apr 2 19:41:44 1997 ---- /sys/netinet/ip_input.c Wed Apr 2 19:28:53 1997 +*** /sys/netinet/ip_input.c.orig Sat May 24 13:37:16 1997 +--- /sys/netinet/ip_input.c Sat May 24 13:38:58 1997 *************** *** 74,79 **** --- 74,82 ---- @@ -13,7 +13,7 @@ int rsvp_on = 0; static int ip_rsvp_on; *************** -*** 310,316 **** +*** 310,315 **** --- 313,327 ---- * - Wrap: fake packet's addr/port <unimpl.> * - Encapsulate: put it in another IP and send out. <unimp.> @@ -21,12 +21,12 @@ + #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 index 3f53ac7..d3cebd0 100644 --- a/contrib/ipfilter/FreeBSD-2.2/ip_output.c.diffs +++ b/contrib/ipfilter/FreeBSD-2.2/ip_output.c.diffs @@ -1,5 +1,5 @@ -*** ip_output.c.orig Wed Apr 2 19:41:48 1997 ---- /sys/netinet/ip_output.c Wed Apr 2 19:38:19 1997 +*** /sys/netinet/ip_output.c.orig Sat May 24 14:07:24 1997 +--- /sys/netinet/ip_output.c Sat May 24 15:00:29 1997 *************** *** 67,72 **** --- 67,76 ---- @@ -31,7 +31,7 @@ static int ip_setmoptions __P((int, struct ip_moptions **, struct mbuf *)); *************** -*** 338,344 **** +*** 338,343 **** --- 342,358 ---- * - Wrap: fake packet's addr/port <unimpl.> * - Encapsulate: put it in another IP and send out. <unimp.> @@ -39,17 +39,17 @@ + #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) ++ 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, @@ -59,7 +59,7 @@ ip_optcopy(ip, jp) struct ip *ip, *jp; { ---- 573,579 ---- +--- 574,580 ---- * Copy options from ip to jp, * omitting those not copied during fragmentation. */ diff --git a/contrib/ipfilter/FreeBSD-2.2/kinstall b/contrib/ipfilter/FreeBSD-2.2/kinstall new file mode 100755 index 0000000..0354685 --- /dev/null +++ b/contrib/ipfilter/FreeBSD-2.2/kinstall @@ -0,0 +1,61 @@ +#!/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 -n "Installing " +foreach i (ip_fil.[ch] ip_nat.[ch] ip_frag.[ch] ip_state.[ch] fil.c \ + ip_proxy.[ch] ip_ftp_pxy.c mlf_ipl.c ipl.h ip_compat.h) + echo -n "$i "; + cp $i /sys/netinet + chmod 644 /sys/netinet/$i +end +echo "" +echo "Copying /usr/include/osreldate.h to /sys/sys" +cp /usr/include/osreldate.h /sys/sys +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) + +if ( -f /sys/conf/files.newconf ) then + echo "Patching /sys/conf/files.newconf" + cat FreeBSD-2.2/files.newconf.diffs | (cd /sys/conf; patch) + echo "Patching /sys/conf/files" + cat FreeBSD-2.2/files.diffs | (cd /sys/conf; patch) +endif +if ( -f /sys/conf/files.oldconf ) then + echo "Patching /sys/conf/files.oldconf" + cat FreeBSD-2.2/files.oldconf.diffs | (cd /sys/conf; patch) + echo "Patching /sys/conf/files" + cat FreeBSD-2.2/filez.diffs | (cd /sys/conf; patch) +endif + +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"}}' \ + $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/unkinstall b/contrib/ipfilter/FreeBSD-2.2/unkinstall new file mode 100755 index 0000000..e31edfb --- /dev/null +++ b/contrib/ipfilter/FreeBSD-2.2/unkinstall @@ -0,0 +1,55 @@ +#!/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 -n "Uninstalling " +foreach i (ip_fil.[ch] ip_nat.[ch] ip_frag.[ch] ip_state.[ch] fil.c ip_compat.h) + echo -n "$i "; + /bin/rm -f /sys/netinet/$i +end +echo "" +echo "Unpatching 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 -R) + +if ( -f /sys/conf/files.newconf ) then + echo "Unpatching /sys/conf/files.newconf" + cat FreeBSD-2.2/files.newconf.diffs | (cd /sys/conf; patch -R) + echo "Unpatching /sys/conf/files" + cat FreeBSD-2.2/files.diffs | (cd /sys/conf; patch -R) +endif +if ( -f /sys/conf/files.oldconf ) then + echo "Unpatching /sys/conf/files.oldconf" + cat FreeBSD-2.2/files.oldconf.diffs | (cd /sys/conf; patch -R) + echo "Unpatching /sys/conf/files" + cat FreeBSD-2.2/filez.diffs | (cd /sys/conf; patch -R) +endif + +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 +egrep -v IPFILTER $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 index abb2631..07aaac0 100755 --- a/contrib/ipfilter/FreeBSD-2.2/unminstall +++ b/contrib/ipfilter/FreeBSD-2.2/unminstall @@ -6,9 +6,9 @@ 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 .. +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 | \ +cat FreeBSD-2.2/ip_{in,out}put.c.diffs FreeBSD-2.2/in_proto.c.diffs | \ (cd /sys/netinet; patch -R) set config=`(cd $confdir; /bin/ls -1t [0-9A-Z_]*) | head -1` |