Compare commits

..

5 Commits

Author SHA1 Message Date
Tom Eastep
7a6f975af4 Revert "Supply sysconfig file for additional distributions"
This reverts commit 1a762c20da.
2015-12-27 16:40:32 -08:00
Tom Eastep
1a762c20da Supply sysconfig file for additional distributions
- Also, add OpenWRT support to the Shorewall-init installer

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2015-12-27 16:35:22 -08:00
Tom Eastep
c9f57ad9c9 Update manpages for ADD timeout
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2015-12-24 09:20:42 -08:00
Tom Eastep
694dc64900 Allow comma in disposition when LOGTAGONLY=Yes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2015-12-23 09:06:43 -08:00
Tom Eastep
54b6488113 Allow a timeout to be specified in ADD rules
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2015-12-23 08:24:00 -08:00
4 changed files with 25 additions and 5 deletions

View File

@@ -6242,7 +6242,7 @@ sub log_rule_limit( $$$$$$$$ ) {
if ( $tag =~ /^,/ ) {
( $disposition = $tag ) =~ s/,//;
} elsif ( $tag =~ /,/ ) {
( $chain, $disposition ) = split ',', $tag;
( $chain, $disposition ) = split ',', $tag, 2;
} else {
$chain = $tag;
}
@@ -6336,7 +6336,7 @@ sub log_irule_limit( $$$$$$$@ ) {
if ( $tag =~ /^,/ ) {
( $disposition = $tag ) =~ s/,//;
} elsif ( $tag =~ /,/ ) {
( $chain, $disposition ) = split ',', $tag;
( $chain, $disposition ) = split ',', $tag, 2;
} else {
$chain = $tag;
}

View File

@@ -2477,13 +2477,21 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
$actiontype |= HELPER;
} elsif ( $actiontype & SET ) {
my %xlate = ( ADD => 'add-set' , DEL => 'del-set' );
my ( $setname, $flags, $timeout, $rest ) = split ':', $param, 4;
my ( $setname, $flags, $rest ) = split ':', $param, 3;
fatal_error "Invalid ADD/DEL parameter ($param)" if $rest;
$setname =~ s/^\+//;
fatal_error "Expected ipset name ($setname)" unless $setname =~ /^(6_)?[a-zA-Z][-\w]*$/;
fatal_error "Invalid flags ($flags)" unless defined $flags && $flags =~ /^(dst|src)(,(dst|src)){0,5}$/;
fatal_error "Invalid flags ($flags)" unless defined $flags && $flags =~ /^(dst|src)(,(dst|src)){0,5}$/;
$action = join( ' ', 'SET --' . $xlate{$basictarget} , $setname , $flags );
if ( supplied $timeout ) {
fatal_error "A timeout may only be supplied in an ADD rule" unless $basictarget eq 'ADD';
fatal_error "Invalid Timeout ($timeout)" unless $timeout && $timeout =~ /^\d+$/;
$action .= " --timeout $timeout";
}
}
}
#

View File

@@ -241,7 +241,7 @@
<varlistentry>
<term><emphasis
role="bold">ADD(<replaceable>ipset</replaceable>:<replaceable>flags</replaceable>)</emphasis></term>
role="bold">ADD(<replaceable>ipset</replaceable>:<replaceable>flags</replaceable>[:<replaceable>timeout</replaceable>])</emphasis></term>
<listitem>
<para>Added in Shorewall 4.4.12. Causes addresses and/or port
@@ -256,6 +256,12 @@
role="bold">dst</emphasis> respectively (see the -A command in
ipset (8)).</para>
<para>Beginning with Shorewall 5.0.3, an optional
<replaceable>timeout</replaceable> can be specified. This is
the number of seconds that the new entry in the ipset is to
remain valid and overrides any timeout specified when the
ipset was created.</para>
<para>ADD is non-terminating. Even if a packet matches the
rule, it is passed on to the next rule.</para>
</listitem>

View File

@@ -229,6 +229,12 @@
role="bold">dst</emphasis> respectively (see the -A command in
ipset (8)).</para>
<para>Beginning with Shorewall 5.0.3, an optional
<replaceable>timeout</replaceable> can be specified. This is
the number of seconds that the new entry in the ipset is to
remain valid and overrides any timeout specified when the
ipset was created.</para>
<para>ADD is non-terminating. Even if a packet matches the
rule, it is passed on to the next rule.</para>
</listitem>