diff --git a/Shorewall/Perl/Shorewall/Raw.pm b/Shorewall/Perl/Shorewall/Raw.pm index 1e0f4102b..87b867856 100644 --- a/Shorewall/Perl/Shorewall/Raw.pm +++ b/Shorewall/Perl/Shorewall/Raw.pm @@ -146,20 +146,16 @@ sub process_conntrack_rule( $$$$$$$$$$ ) { if ( $option eq 'helper' ) { my $modifiers = ''; - $disposition = "helper"; + $disposition = 'helper'; - if ( $args =~ /^([-\w.]*)\((.+)\)$/ ) { + if ( $args =~ /^([-\w.]+)\((.+)\)$/ ) { $args = $1; $modifiers = $2; } - if ( supplied $args ) { - fatal_error "Invalid helper' ($args)" if $args =~ /,/; - validate_helper( $args, $proto ); - $action = "CT --helper $helpers_aliases{$args}"; - } else { - $action = "CT "; - } + fatal_error "Invalid helper' ($args)" if $args =~ /,/; + validate_helper( $args, $proto ); + $action = "CT --helper $helpers_aliases{$args}"; $exception_rule = do_proto( $proto, '-', '-' ); @@ -181,6 +177,17 @@ sub process_conntrack_rule( $$$$$$$$$$ ) { fatal_error "Invalid helper option ($mod)"; } } + } elsif ( $option eq 'ctevents' ) { + $disposition = 'helper'; + + for ( split_list( $args, 'ctevents' ) ) { + fatal_error "Invalid 'ctevents' event ($_)" unless $valid_ctevent{$_}; + } + + $action = "CT --ctevents $args"; + } elsif ( $option eq 'expevents' ) { + fatal_error "Invalid expevent argument ($args)" unless $args eq 'new'; + $action = 'CT --expevents new'; } else { fatal_error "Invalid CT option ($option)"; } diff --git a/Shorewall/manpages/shorewall-conntrack.xml b/Shorewall/manpages/shorewall-conntrack.xml index 4a8aaf05e..cf8ac57e0 100644 --- a/Shorewall/manpages/shorewall-conntrack.xml +++ b/Shorewall/manpages/shorewall-conntrack.xml @@ -90,7 +90,8 @@ role="bold">NOTRACK|CT:helper:name[(arg=val[,...])|CT:helper:(arg=val[,...])|CT:notrack|DROP|LOG|ULOG(ulog-parameters):NFLOG(nflog-parameters)|IPTABLES(target)}[log-level[:log-tag]][:chain-designator] + role="bold">CT:ctevents:event[,...]|CT:expevents:new|CT:notrack|DROP|LOG|ULOG(ulog-parameters):NFLOG(nflog-parameters)|IPTABLES(target)}[log-level[:log-tag]][:chain-designator] This column is only present when FORMAT >= 2. Values other @@ -243,11 +244,31 @@ expectation events for this connection. + - Beginning with Shorewall 4.6.10, the parenthesized list of - arg=val - pairs may be given without a helper name (e.g., - CT:helper:(ctevents=assured,destroyed)). + + ctevents:event[,...] + + Added in Shorewall 4.6.10. Only generate the specified + conntrack events for this connection. Possible event types are: + new, related, destroy, reply, assured, protoinfo, helper, mark (this is connection mark, not packet + mark), natseqinfo, and + secmark. + + + + expevents=new + + Added in Shorewall 4.6.10. Only generate new expectation events for this + connection. diff --git a/Shorewall6/manpages/shorewall6-conntrack.xml b/Shorewall6/manpages/shorewall6-conntrack.xml index 0ea0e413d..ea661658f 100644 --- a/Shorewall6/manpages/shorewall6-conntrack.xml +++ b/Shorewall6/manpages/shorewall6-conntrack.xml @@ -90,8 +90,7 @@ role="bold">NOTRACK|CT:helper:name[(arg=val[,...])|CT:helper:(arg=val[,...])|CT:notrack|DROP|LOG|NFLOG(nflog-parameters)|IP6TABLES(target)}[:log-level[:log-tag]][:chain-designator] + role="bold">CT:ctevents:event[,...]|CT:expevents:new|notrack|DROP|LOG|NFLOG(nflog-parameters)|IP6TABLES(target)}[:log-level[:log-tag]][:chain-designator] This column is only present when FORMAT >= 2. Values other @@ -239,15 +238,35 @@ - Only generate a new + Only generate new expectation events for this connection. + - Beginning with Shorewall 4.6.10, the parenthesized list of - arg=val - pairs may be given without a helper name (e.g., - CT:helper:(ctevents=assured,destroyed)). + + ctevents:event[,...] + + Added in Shorewall 4.6.10. Only generate the specified + conntrack events for this connection. Possible event types are: + new, related, destroy, reply, assured, protoinfo, helper, mark (this is connection mark, not packet + mark), natseqinfo, and + secmark. + + + + expevents=new + + Added in Shorewall 4.6.10. Only generate new expectation events for this + connection.