On 11/18/12 11:33 AM, Tom Eastep wrote: >> 4. NFLOG ACTION statement not recognised by shorewall. >> >> According to "man shorewall-rules", I can include NFLOG in the ACTION >> column (in a similar fashion as I specify "ACCEPT", "DROP", "LOG" etc). >> This ain't so: >> >> /etc/shorewall/rules >> ~~~~~~~~~~~~~~~~~~~~ >> NFLOG(1,0,1) >> >> gives me "ERROR: Unknown ACTION (NFLOG(1,0,1))". I suffer a similar >> faith if I wish to include the same statement as part of action or a >> macro. Why? > > That's an error in the manpage -- to use NFLOG, specify "LOG:NFLOG(1,0,1)".
I decided to change the code rather than the manpage -- patch attached. -Tom -- Tom Eastep \ When I die, I want to go like my Grandfather who Shoreline, \ died peacefully in his sleep. Not screaming like Washington, USA \ all of the passengers in his car http://shorewall.net \________________________________________________
diff --git a/Shorewall/Perl/Shorewall/Rules.pm
b/Shorewall/Perl/Shorewall/Rules.pm
index 68dc1c0..a1aa5d5 100644
--- a/Shorewall/Perl/Shorewall/Rules.pm
+++ b/Shorewall/Perl/Shorewall/Rules.pm
@@ -1714,6 +1714,16 @@ sub process_rule1 ( $$$$$$$$$$$$$$$$$$ ) {
( $basictarget, $actiontype , $param ) = map_old_actions( $basictarget
) unless $actiontype || $param;
}
+ unless ( $actiontype ) {
+ if ( $action =~ /^NFLOG\(?/ ) {
+ $basictarget = 'LOG';
+ $actiontype = $targets{LOG};
+ fatal_error "Invalid NFLOG action($action:$loglevel)" if $loglevel;
+ $loglevel = supplied $param ? "NFLOG($param)" : 'NFLOG';
+ $param = '';
+ }
+ }
+
fatal_error "Unknown ACTION ($action)" unless $actiontype;
if ( $actiontype == MACRO ) {
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________ Shorewall-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/shorewall-devel
