From cff5e07509d96338b8d4dca4a2bd8b6d06f98a83 Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Wed, 24 Mar 1999 10:28:49 +0000 Subject: [PATCH] Move natd from network_pass3 to network_pass1 --- etc/network.subr | 31 +++++++++++++++---------------- etc/rc.d/netoptions | 31 +++++++++++++++---------------- etc/rc.d/network1 | 31 +++++++++++++++---------------- etc/rc.d/network2 | 31 +++++++++++++++---------------- etc/rc.d/network3 | 31 +++++++++++++++---------------- etc/rc.d/routing | 31 +++++++++++++++---------------- etc/rc.network | 31 +++++++++++++++---------------- 7 files changed, 105 insertions(+), 112 deletions(-) diff --git a/etc/network.subr b/etc/network.subr index e54589fd135a..12300c095e78 100644 --- a/etc/network.subr +++ b/etc/network.subr @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.39 1999/01/13 17:32:37 joerg Exp $ +# $Id: rc.network,v 1.40 1999/03/11 16:17:24 jfitz Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -100,10 +100,21 @@ network_pass1() { # Load the filters if required if [ $firewall_in_kernel = 1 ]; then - if [ -n "$firewall_enable" -a -f /etc/rc.firewall -a \ - "x$firewall_enable" = "xYES" ] ; then + if [ -f /etc/rc.firewall -a X"$firewall_enable" = X"YES" ]; then . /etc/rc.firewall - echo "Firewall rules loaded." + echo -n 'Firewall rules loaded, starting divert daemons: ' + + # Network Address Translation daemon + if [ X"${natd_enable}" = X"YES" -a -n "${natd_interface}" ]; then + if echo ${natd_interface} | \ + grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then + natd_ifarg="-a ${natd_interface}" + else + natd_ifarg="-n ${natd_interface}" + fi + echo -n ' natd'; ${natd_program} ${natd_flags} ${natd_ifarg} + fi + echo '.' else IPFW_DEFAULT=`ipfw l 65535` if [ "$IPFW_DEFAULT" = "65535 deny ip from any to any" ]; then @@ -311,18 +322,6 @@ network_pass3() { unset stash_flag fi - # Network Address Translation daemon - if [ "X${natd_enable}" = X"YES" -a X"${natd_interface}" != X"" \ - -a X"${firewall_enable}" = X"YES" ]; then - if echo ${natd_interface} | \ - grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then - natd_ifarg="-a ${natd_interface}" - else - natd_ifarg="-n ${natd_interface}" - fi - echo -n ' natd'; natd ${natd_flags} ${natd_ifarg} - fi - echo '.' network_pass3_done=YES } diff --git a/etc/rc.d/netoptions b/etc/rc.d/netoptions index e54589fd135a..12300c095e78 100644 --- a/etc/rc.d/netoptions +++ b/etc/rc.d/netoptions @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.39 1999/01/13 17:32:37 joerg Exp $ +# $Id: rc.network,v 1.40 1999/03/11 16:17:24 jfitz Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -100,10 +100,21 @@ network_pass1() { # Load the filters if required if [ $firewall_in_kernel = 1 ]; then - if [ -n "$firewall_enable" -a -f /etc/rc.firewall -a \ - "x$firewall_enable" = "xYES" ] ; then + if [ -f /etc/rc.firewall -a X"$firewall_enable" = X"YES" ]; then . /etc/rc.firewall - echo "Firewall rules loaded." + echo -n 'Firewall rules loaded, starting divert daemons: ' + + # Network Address Translation daemon + if [ X"${natd_enable}" = X"YES" -a -n "${natd_interface}" ]; then + if echo ${natd_interface} | \ + grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then + natd_ifarg="-a ${natd_interface}" + else + natd_ifarg="-n ${natd_interface}" + fi + echo -n ' natd'; ${natd_program} ${natd_flags} ${natd_ifarg} + fi + echo '.' else IPFW_DEFAULT=`ipfw l 65535` if [ "$IPFW_DEFAULT" = "65535 deny ip from any to any" ]; then @@ -311,18 +322,6 @@ network_pass3() { unset stash_flag fi - # Network Address Translation daemon - if [ "X${natd_enable}" = X"YES" -a X"${natd_interface}" != X"" \ - -a X"${firewall_enable}" = X"YES" ]; then - if echo ${natd_interface} | \ - grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then - natd_ifarg="-a ${natd_interface}" - else - natd_ifarg="-n ${natd_interface}" - fi - echo -n ' natd'; natd ${natd_flags} ${natd_ifarg} - fi - echo '.' network_pass3_done=YES } diff --git a/etc/rc.d/network1 b/etc/rc.d/network1 index e54589fd135a..12300c095e78 100644 --- a/etc/rc.d/network1 +++ b/etc/rc.d/network1 @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.39 1999/01/13 17:32:37 joerg Exp $ +# $Id: rc.network,v 1.40 1999/03/11 16:17:24 jfitz Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -100,10 +100,21 @@ network_pass1() { # Load the filters if required if [ $firewall_in_kernel = 1 ]; then - if [ -n "$firewall_enable" -a -f /etc/rc.firewall -a \ - "x$firewall_enable" = "xYES" ] ; then + if [ -f /etc/rc.firewall -a X"$firewall_enable" = X"YES" ]; then . /etc/rc.firewall - echo "Firewall rules loaded." + echo -n 'Firewall rules loaded, starting divert daemons: ' + + # Network Address Translation daemon + if [ X"${natd_enable}" = X"YES" -a -n "${natd_interface}" ]; then + if echo ${natd_interface} | \ + grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then + natd_ifarg="-a ${natd_interface}" + else + natd_ifarg="-n ${natd_interface}" + fi + echo -n ' natd'; ${natd_program} ${natd_flags} ${natd_ifarg} + fi + echo '.' else IPFW_DEFAULT=`ipfw l 65535` if [ "$IPFW_DEFAULT" = "65535 deny ip from any to any" ]; then @@ -311,18 +322,6 @@ network_pass3() { unset stash_flag fi - # Network Address Translation daemon - if [ "X${natd_enable}" = X"YES" -a X"${natd_interface}" != X"" \ - -a X"${firewall_enable}" = X"YES" ]; then - if echo ${natd_interface} | \ - grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then - natd_ifarg="-a ${natd_interface}" - else - natd_ifarg="-n ${natd_interface}" - fi - echo -n ' natd'; natd ${natd_flags} ${natd_ifarg} - fi - echo '.' network_pass3_done=YES } diff --git a/etc/rc.d/network2 b/etc/rc.d/network2 index e54589fd135a..12300c095e78 100644 --- a/etc/rc.d/network2 +++ b/etc/rc.d/network2 @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.39 1999/01/13 17:32:37 joerg Exp $ +# $Id: rc.network,v 1.40 1999/03/11 16:17:24 jfitz Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -100,10 +100,21 @@ network_pass1() { # Load the filters if required if [ $firewall_in_kernel = 1 ]; then - if [ -n "$firewall_enable" -a -f /etc/rc.firewall -a \ - "x$firewall_enable" = "xYES" ] ; then + if [ -f /etc/rc.firewall -a X"$firewall_enable" = X"YES" ]; then . /etc/rc.firewall - echo "Firewall rules loaded." + echo -n 'Firewall rules loaded, starting divert daemons: ' + + # Network Address Translation daemon + if [ X"${natd_enable}" = X"YES" -a -n "${natd_interface}" ]; then + if echo ${natd_interface} | \ + grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then + natd_ifarg="-a ${natd_interface}" + else + natd_ifarg="-n ${natd_interface}" + fi + echo -n ' natd'; ${natd_program} ${natd_flags} ${natd_ifarg} + fi + echo '.' else IPFW_DEFAULT=`ipfw l 65535` if [ "$IPFW_DEFAULT" = "65535 deny ip from any to any" ]; then @@ -311,18 +322,6 @@ network_pass3() { unset stash_flag fi - # Network Address Translation daemon - if [ "X${natd_enable}" = X"YES" -a X"${natd_interface}" != X"" \ - -a X"${firewall_enable}" = X"YES" ]; then - if echo ${natd_interface} | \ - grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then - natd_ifarg="-a ${natd_interface}" - else - natd_ifarg="-n ${natd_interface}" - fi - echo -n ' natd'; natd ${natd_flags} ${natd_ifarg} - fi - echo '.' network_pass3_done=YES } diff --git a/etc/rc.d/network3 b/etc/rc.d/network3 index e54589fd135a..12300c095e78 100644 --- a/etc/rc.d/network3 +++ b/etc/rc.d/network3 @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.39 1999/01/13 17:32:37 joerg Exp $ +# $Id: rc.network,v 1.40 1999/03/11 16:17:24 jfitz Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -100,10 +100,21 @@ network_pass1() { # Load the filters if required if [ $firewall_in_kernel = 1 ]; then - if [ -n "$firewall_enable" -a -f /etc/rc.firewall -a \ - "x$firewall_enable" = "xYES" ] ; then + if [ -f /etc/rc.firewall -a X"$firewall_enable" = X"YES" ]; then . /etc/rc.firewall - echo "Firewall rules loaded." + echo -n 'Firewall rules loaded, starting divert daemons: ' + + # Network Address Translation daemon + if [ X"${natd_enable}" = X"YES" -a -n "${natd_interface}" ]; then + if echo ${natd_interface} | \ + grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then + natd_ifarg="-a ${natd_interface}" + else + natd_ifarg="-n ${natd_interface}" + fi + echo -n ' natd'; ${natd_program} ${natd_flags} ${natd_ifarg} + fi + echo '.' else IPFW_DEFAULT=`ipfw l 65535` if [ "$IPFW_DEFAULT" = "65535 deny ip from any to any" ]; then @@ -311,18 +322,6 @@ network_pass3() { unset stash_flag fi - # Network Address Translation daemon - if [ "X${natd_enable}" = X"YES" -a X"${natd_interface}" != X"" \ - -a X"${firewall_enable}" = X"YES" ]; then - if echo ${natd_interface} | \ - grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then - natd_ifarg="-a ${natd_interface}" - else - natd_ifarg="-n ${natd_interface}" - fi - echo -n ' natd'; natd ${natd_flags} ${natd_ifarg} - fi - echo '.' network_pass3_done=YES } diff --git a/etc/rc.d/routing b/etc/rc.d/routing index e54589fd135a..12300c095e78 100644 --- a/etc/rc.d/routing +++ b/etc/rc.d/routing @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.39 1999/01/13 17:32:37 joerg Exp $ +# $Id: rc.network,v 1.40 1999/03/11 16:17:24 jfitz Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -100,10 +100,21 @@ network_pass1() { # Load the filters if required if [ $firewall_in_kernel = 1 ]; then - if [ -n "$firewall_enable" -a -f /etc/rc.firewall -a \ - "x$firewall_enable" = "xYES" ] ; then + if [ -f /etc/rc.firewall -a X"$firewall_enable" = X"YES" ]; then . /etc/rc.firewall - echo "Firewall rules loaded." + echo -n 'Firewall rules loaded, starting divert daemons: ' + + # Network Address Translation daemon + if [ X"${natd_enable}" = X"YES" -a -n "${natd_interface}" ]; then + if echo ${natd_interface} | \ + grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then + natd_ifarg="-a ${natd_interface}" + else + natd_ifarg="-n ${natd_interface}" + fi + echo -n ' natd'; ${natd_program} ${natd_flags} ${natd_ifarg} + fi + echo '.' else IPFW_DEFAULT=`ipfw l 65535` if [ "$IPFW_DEFAULT" = "65535 deny ip from any to any" ]; then @@ -311,18 +322,6 @@ network_pass3() { unset stash_flag fi - # Network Address Translation daemon - if [ "X${natd_enable}" = X"YES" -a X"${natd_interface}" != X"" \ - -a X"${firewall_enable}" = X"YES" ]; then - if echo ${natd_interface} | \ - grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then - natd_ifarg="-a ${natd_interface}" - else - natd_ifarg="-n ${natd_interface}" - fi - echo -n ' natd'; natd ${natd_flags} ${natd_ifarg} - fi - echo '.' network_pass3_done=YES } diff --git a/etc/rc.network b/etc/rc.network index e54589fd135a..12300c095e78 100644 --- a/etc/rc.network +++ b/etc/rc.network @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.39 1999/01/13 17:32:37 joerg Exp $ +# $Id: rc.network,v 1.40 1999/03/11 16:17:24 jfitz Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -100,10 +100,21 @@ network_pass1() { # Load the filters if required if [ $firewall_in_kernel = 1 ]; then - if [ -n "$firewall_enable" -a -f /etc/rc.firewall -a \ - "x$firewall_enable" = "xYES" ] ; then + if [ -f /etc/rc.firewall -a X"$firewall_enable" = X"YES" ]; then . /etc/rc.firewall - echo "Firewall rules loaded." + echo -n 'Firewall rules loaded, starting divert daemons: ' + + # Network Address Translation daemon + if [ X"${natd_enable}" = X"YES" -a -n "${natd_interface}" ]; then + if echo ${natd_interface} | \ + grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then + natd_ifarg="-a ${natd_interface}" + else + natd_ifarg="-n ${natd_interface}" + fi + echo -n ' natd'; ${natd_program} ${natd_flags} ${natd_ifarg} + fi + echo '.' else IPFW_DEFAULT=`ipfw l 65535` if [ "$IPFW_DEFAULT" = "65535 deny ip from any to any" ]; then @@ -311,18 +322,6 @@ network_pass3() { unset stash_flag fi - # Network Address Translation daemon - if [ "X${natd_enable}" = X"YES" -a X"${natd_interface}" != X"" \ - -a X"${firewall_enable}" = X"YES" ]; then - if echo ${natd_interface} | \ - grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then - natd_ifarg="-a ${natd_interface}" - else - natd_ifarg="-n ${natd_interface}" - fi - echo -n ' natd'; natd ${natd_flags} ${natd_ifarg} - fi - echo '.' network_pass3_done=YES }