Compare commits

...

8 Commits

Author SHA1 Message Date
Tom Eastep
34f2aeacea Correct 'sed' command
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-10-22 09:59:30 -07:00
Tom Eastep
b160845713 Avoid compiler crash when LOAD_HELPERS_ONLY=Yes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-10-20 15:22:43 -07:00
Tom Eastep
b44628ddc8 Only specify 'counters' to ipset of IPSET_MATCH_COUNTERS is present
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-10-20 09:07:36 -07:00
Tom Eastep
31b6e9e299 Fix another DEST bug in mangle inline action handling :-(
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-10-18 10:15:43 -07:00
Tom Eastep
9fc56bb896 Correct typo in process_mangle_inline()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-10-17 09:29:32 -07:00
Tom Eastep
2c191bf595 Correct .conf manpages
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-10-16 15:07:34 -07:00
Tom Eastep
4bb942f1f9 Restrict hypen as range separator to use with integers
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-10-16 13:29:00 -07:00
Tom Eastep
04051454bf Reverse bad ECN handling patch
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-10-16 12:27:45 -07:00
9 changed files with 23 additions and 19 deletions

View File

@@ -3566,7 +3566,7 @@ blacklist_command() {
if [ $VERBOSITY -gt 1 ]; then if [ $VERBOSITY -gt 1 ]; then
echo "$message" | awk '/have been deleted/ { sub( /^.*: /, "" ); sub( / /, " src " ); }; { print; }' echo "$message" | awk '/have been deleted/ { sub( /^.*: /, "" ); sub( / /, " src " ); }; { print; }'
else else
echo "$message" | head -n1 | sed '/^.*: //; s/ / src /' echo "$message" | head -n1 | sed 's/^.*: //; s/ / src /'
fi fi
fi fi
@@ -3576,7 +3576,7 @@ blacklist_command() {
if [ $VERBOSITY -gt 1 ]; then if [ $VERBOSITY -gt 1 ]; then
echo "$message" | awk '/have been deleted/ { sub( /^.*: /, "" ); sub( / /, " dst " ); }; { print; }' echo "$message" | awk '/have been deleted/ { sub( /^.*: /, "" ); sub( / /, " dst " ); }; { print; }'
else else
echo "$message" | head -n1 | sed '/^.*: //; s/ / dst /' echo "$message" | head -n1 | sed 's/^.*: //; s/ / dst /'
fi fi
fi fi
fi fi

View File

@@ -8265,6 +8265,7 @@ EOF
sub ensure_ipsets( @ ) { sub ensure_ipsets( @ ) {
my $set; my $set;
my $counters = have_capability( 'IPSET_MATCH_COUNTERS' ) ? ' counters' : '';
if ( $globals{DBL_TIMEOUT} ne '' && $_[0] eq $globals{DBL_IPSET} ) { if ( $globals{DBL_TIMEOUT} ne '' && $_[0] eq $globals{DBL_IPSET} ) {
shift; shift;
@@ -8277,12 +8278,12 @@ sub ensure_ipsets( @ ) {
emit( q( #), emit( q( #),
q( # Set the timeout for the dynamic blacklisting ipset), q( # Set the timeout for the dynamic blacklisting ipset),
q( #), q( #),
qq( \$IPSET -exist create $globals{DBL_IPSET} hash:net family inet timeout $globals{DBL_TIMEOUT} counters) ); qq( \$IPSET -exist create $globals{DBL_IPSET} hash:net family inet timeout $globals{DBL_TIMEOUT}${counters}) );
} else { } else {
emit( q( #), emit( q( #),
q( # Set the timeout for the dynamic blacklisting ipset), q( # Set the timeout for the dynamic blacklisting ipset),
q( #), q( #),
qq( \$IPSET -exist create $globals{DBL_IPSET} hash:net family inet6 timeout $globals{DBL_TIMEOUT} counters) ); qq( \$IPSET -exist create $globals{DBL_IPSET} hash:net family inet6 timeout $globals{DBL_TIMEOUT}${counters}) );
} }
pop_indent; pop_indent;
@@ -8304,7 +8305,7 @@ sub ensure_ipsets( @ ) {
if ( have_capability 'IPSET_V5' ) { if ( have_capability 'IPSET_V5' ) {
emit ( qq( if ! qt \$IPSET list $set -n; then) , emit ( qq( if ! qt \$IPSET list $set -n; then) ,
qq( error_message "WARNING: ipset $set does not exist; creating it as an hash:net set") , qq( error_message "WARNING: ipset $set does not exist; creating it as an hash:net set") ,
qq( \$IPSET create $set hash:net family inet timeout 0 counters) , qq( \$IPSET create $set hash:net family inet timeout 0${counters}) ,
qq( fi) ); qq( fi) );
} else { } else {
emit ( qq( if ! qt \$IPSET -L $set -n; then) , emit ( qq( if ! qt \$IPSET -L $set -n; then) ,
@@ -8315,7 +8316,7 @@ sub ensure_ipsets( @ ) {
} else { } else {
emit ( qq( if ! qt \$IPSET list $set -n; then) , emit ( qq( if ! qt \$IPSET list $set -n; then) ,
qq( error_message "WARNING: ipset $set does not exist; creating it as an hash:net set") , qq( error_message "WARNING: ipset $set does not exist; creating it as an hash:net set") ,
qq( \$IPSET create $set hash:net family inet6 timeout 0 counters) , qq( \$IPSET create $set hash:net family inet6 timeout 0${counters}) ,
qq( fi) ); qq( fi) );
} }

View File

@@ -4544,11 +4544,11 @@ sub IPSet_Match() {
} }
sub IPSet_Match_Nomatch() { sub IPSet_Match_Nomatch() {
have_capability 'IPSET_MATCH' && $capabilities{IPSET_MATCH_NOMATCH}; have_capability( 'IPSET_MATCH' ) && $capabilities{IPSET_MATCH_NOMATCH};
} }
sub IPSet_Match_Counters() { sub IPSet_Match_Counters() {
have_capability 'IPSET_MATCH' && $capabilities{IPSET_MATCH_COUNTERS}; have_capability( 'IPSET_MATCH' ) && $capabilities{IPSET_MATCH_COUNTERS};
} }
sub IPSET_V5() { sub IPSET_V5() {

View File

@@ -436,7 +436,7 @@ sub validate_portpair( $$ ) {
# #
# Accept '-' as a port-range separator # Accept '-' as a port-range separator
# #
$pair =~ tr/-/:/; $pair =~ tr/-/:/ if $pair =~ /^[-0-9]+$/;
fatal_error "Invalid port range ($portpair)" if $pair =~ tr/:/:/ > 1; fatal_error "Invalid port range ($portpair)" if $pair =~ tr/:/:/ > 1;

View File

@@ -134,12 +134,12 @@ sub setup_ecn()
for my $interface ( @interfaces ) { for my $interface ( @interfaces ) {
my $chainref = ensure_chain 'mangle', ecn_chain( $interface ); my $chainref = ensure_chain 'mangle', ecn_chain( $interface );
add_ijump $mangle_table->{POSTROUTING} , j => $chainref, $interfaces{$interface}, p => 'tcp', imatch_dest_dev( $interface ) if have_capability 'MANGLE_FORWARD'; add_ijump_extended $mangle_table->{POSTROUTING} , j => $chainref, $interfaces{$interface}, p => 'tcp', imatch_dest_dev( $interface ) if have_capability 'MANGLE_FORWARD';
add_ijump $mangle_table->{OUTPUT}, j => $chainref, $interfaces{$interface}, p => 'tcp', imatch_dest_dev( $interface ); add_ijump_extended $mangle_table->{OUTPUT}, j => $chainref, $interfaces{$interface}, p => 'tcp', imatch_dest_dev( $interface );
} }
for my $host ( @hosts ) { for my $host ( @hosts ) {
add_ijump( $mangle_table->{ecn_chain $host->[0]}, j => 'ECN', $host->[1], targetopts => '--ecn-tcp-remove', p => 'tcp', imatch_dest_net( $host->[2] ) ); add_ijump_extended( $mangle_table->{ecn_chain $host->[0]}, j => 'ECN', $host->[1], targetopts => '--ecn-tcp-remove', p => 'tcp', imatch_dest_net( $host->[2] ) );
} }
} }
} }

View File

@@ -3958,14 +3958,14 @@ sub process_mangle_inline( $$$$$$$$$$$$$$$$$$$ ) {
} }
$msource = $source if $msource eq '-'; $msource = $source if $msource eq '-';
$mdest = $dest if $msource eq '-'; $mdest = $dest if $mdest eq '-';
$mprotos = $protos if $mprotos eq '-'; $mprotos = $protos if $mprotos eq '-';
for my $proto (split_list( $mprotos, 'Protocol' ) ) { for my $proto (split_list( $mprotos, 'Protocol' ) ) {
process_mangle_rule1( $chainref, process_mangle_rule1( $chainref,
$moriginalmark, $moriginalmark,
$msource, $msource,
$dest, $mdest,
$proto, $proto,
merge_macro_column( $mports, $ports ), merge_macro_column( $mports, $ports ),
merge_macro_column( $msports, $sports ), merge_macro_column( $msports, $sports ),

View File

@@ -920,7 +920,8 @@ net all DROP info</programlisting>then the chain name is 'net-all'
an administrative system in directories containing the an administrative system in directories containing the
configurations of remote firewalls. The contents of the variable are configurations of remote firewalls. The contents of the variable are
the default value for the <replaceable>system</replaceable> the default value for the <replaceable>system</replaceable>
parameter to the <command>remote-reload</command> and parameter to the <command>remote-start</command>,
<command>remote-reload</command> and
<command>remote-restart</command> commands.</para> <command>remote-restart</command> commands.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@@ -781,7 +781,8 @@ net all DROP info</programlisting>then the chain name is 'net-all'
an administrative system in directories containing the an administrative system in directories containing the
configurations of remote firewalls. The contents of the variable are configurations of remote firewalls. The contents of the variable are
the default value for the <replaceable>system</replaceable> the default value for the <replaceable>system</replaceable>
parameter to the <command>remote-reload</command> and parameter to the <command>remote-start</command>,
<command>remote-reload</command> and
<command>remote-restart</command> commands.</para> <command>remote-restart</command> commands.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@@ -2621,7 +2621,8 @@ DNAT net loc:192.168.1.3 tcp <emphasis role="bold">4000:4100<
"!4000:4100").</para> "!4000:4100").</para>
<para>Beginning with Shorewall 5.0.14, a hyphen ("-") may also be used to <para>Beginning with Shorewall 5.0.14, a hyphen ("-") may also be used to
separate the two port numbers.</para> separate the two port numbers; when using service names, the colon must
still be used.</para>
<programlisting>#ACTION SOURCE DESTINATION PROTO DPORT <programlisting>#ACTION SOURCE DESTINATION PROTO DPORT
DNAT net loc:192.168.1.3 tcp <emphasis role="bold">4000-4100</emphasis></programlisting> DNAT net loc:192.168.1.3 tcp <emphasis role="bold">4000-4100</emphasis></programlisting>