First successfull 'shorewall restart' with Perl compiler

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5575 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-03-19 04:50:37 +00:00
parent 97b0cd1d4a
commit 1fd340c6d7
2 changed files with 22 additions and 9 deletions

View File

@ -123,8 +123,12 @@ sub setup_tunnels() {
( $kind, my ( $proto, $p ) ) = split /:/, $kind; ( $kind, my ( $proto, $p ) ) = split /:/, $kind;
$port = $p if $p; if ( $p ) {
$protocol = $proto if $proto; $port = $p;
$protocol = $proto;
} elsif ( $proto ) {
$port = $proto;
}
add_rule $inchainref, "-p $protocol $source --dport $port -j ACCEPT"; add_rule $inchainref, "-p $protocol $source --dport $port -j ACCEPT";
add_rule $outchainref, "-p $protocol $dest --dport $port -j ACCEPT"; add_rule $outchainref, "-p $protocol $dest --dport $port -j ACCEPT";
@ -138,8 +142,12 @@ sub setup_tunnels() {
( $kind, my ( $proto, $p ) ) = split /:/, $kind; ( $kind, my ( $proto, $p ) ) = split /:/, $kind;
$port = $p if $p; if ( $p ) {
$protocol = $proto if $proto; $port = $p;
$protocol = $proto;
} elsif ( $proto ) {
$port = $proto;
}
add_rule $inchainref, "-p $protocol $source --sport $port -j ACCEPT"; add_rule $inchainref, "-p $protocol $source --sport $port -j ACCEPT";
add_rule $outchainref, "-p $protocol $dest --dport $port -j ACCEPT"; add_rule $outchainref, "-p $protocol $dest --dport $port -j ACCEPT";
@ -153,8 +161,12 @@ sub setup_tunnels() {
( $kind, my ( $proto, $p ) ) = split /:/, $kind; ( $kind, my ( $proto, $p ) ) = split /:/, $kind;
$port = $p if $p; if ( $p ) {
$protocol = $proto if $proto; $port = $p;
$protocol = $proto;
} elsif ( $proto ) {
$port = $proto;
}
add_rule $inchainref, "-p $protocol $source --dport $port -j ACCEPT"; add_rule $inchainref, "-p $protocol $source --dport $port -j ACCEPT";
add_rule $outchainref, "-p $protocol $dest --sport $port -j ACCEPT"; add_rule $outchainref, "-p $protocol $dest --sport $port -j ACCEPT";

View File

@ -83,7 +83,7 @@ sub generate_script_1 {
emit 'CONFDIR=/etc/shorewall'; emit 'CONFDIR=/etc/shorewall';
emit 'VARDIR=/var/lib/shorewall\n'; emit 'VARDIR=/var/lib/shorewall\n';
emit 'PRODUCT=\'Shorewall\''; emit 'PRODUCT=\'Shorewall\'';
emit '. /usr/share/shoreall/lib.base'; emit '. /usr/share/shorewall/lib.base';
} }
emit ''; emit '';
@ -92,6 +92,7 @@ sub generate_script_1 {
emit "run_${exit}_exit() {"; emit "run_${exit}_exit() {";
push_indent; push_indent;
append_file $exit; append_file $exit;
emit 'true';
pop_indent; pop_indent;
emit "}\n"; emit "}\n";
} }
@ -111,7 +112,7 @@ sub generate_script_1 {
emit ' fatal_error "This script requires Shorewall which do not appear to be installed on this system (did you forget \"-e\" when you compiled?)"'; emit ' fatal_error "This script requires Shorewall which do not appear to be installed on this system (did you forget \"-e\" when you compiled?)"';
emit 'fi'; emit 'fi';
emit ''; emit '';
emit 'local version=\$(cat \${SHAREDIR}/version)'; emit 'local version=$(cat ${SHAREDIR}/version)';
emit ''; emit '';
emit 'if [ ${SHOREWALL_LIBVERSION:-0} -lt 30203 ]; then'; emit 'if [ ${SHOREWALL_LIBVERSION:-0} -lt 30203 ]; then';
emit ' fatal_error "This script requires Shorewall version 3.3.3 or later; current version is $version"'; emit ' fatal_error "This script requires Shorewall version 3.3.3 or later; current version is $version"';
@ -514,7 +515,7 @@ sub generate_script_3() {
pop_indent; pop_indent;
emit "}/n"; emit "}\n";
progress_message2 "Creating iptables-restore input..."; progress_message2 "Creating iptables-restore input...";
create_netfilter_load; create_netfilter_load;