diff --git a/Shorewall-perl/Shorewall/Accounting.pm b/Shorewall-perl/Shorewall/Accounting.pm index a26a2029d..422a12c9e 100644 --- a/Shorewall-perl/Shorewall/Accounting.pm +++ b/Shorewall-perl/Shorewall/Accounting.pm @@ -42,8 +42,8 @@ our @VERSION = 1.00; # my $jumpchainref; -sub process_accounting_rule( $$$$$$$$ ) { - my ($action, $chain, $source, $dest, $proto, $ports, $sports, $user ) = @_; +sub process_accounting_rule( $$$$$$$$$ ) { + my ($action, $chain, $source, $dest, $proto, $ports, $sports, $user, $mark ) = @_; sub accounting_error() { warning_message "Invalid Accounting rule"; @@ -61,7 +61,7 @@ sub process_accounting_rule( $$$$$$$$ ) { my $target = ''; - my $rule = do_proto( $proto, $ports, $sports ) . do_user ( $user ); + my $rule = do_proto( $proto, $ports, $sports ) . do_user ( $user ) . do_test ( $mark ); my $rule2 = 0; unless ( $action eq 'COUNT' ) { diff --git a/Shorewall-perl/Shorewall/Nat.pm b/Shorewall-perl/Shorewall/Nat.pm index cda5f0cca..4ab589df6 100644 --- a/Shorewall-perl/Shorewall/Nat.pm +++ b/Shorewall-perl/Shorewall/Nat.pm @@ -95,9 +95,9 @@ sub do_ipsec_options($) # # Process a single rule from the the masq file # -sub setup_one_masq($$$$$$) +sub setup_one_masq($$$$$$$) { - my ($fullinterface, $networks, $addresses, $proto, $ports, $ipsec) = @_; + my ($fullinterface, $networks, $addresses, $proto, $ports, $ipsec, $mark) = @_; my $rule = ''; my $pre_nat; @@ -166,6 +166,10 @@ sub setup_one_masq($$$$$$) # Handle Protocol and Ports # $rule .= do_proto $proto, $ports, ''; + # + # Handle Mark + # + rule .= do_test $mark if $mark ne '-'; my $detectaddress = 0; # @@ -258,7 +262,7 @@ sub setup_masq() while ( read_a_line ) { - my ($fullinterface, $networks, $addresses, $proto, $ports, $ipsec) = split_line 2, 6, 'masq file'; + my ($fullinterface, $networks, $addresses, $proto, $ports, $ipsec, $mark ) = split_line 2, 7, 'masq file'; if ( $first_entry ) { progress_message2 "$doing $fn..."; @@ -274,7 +278,7 @@ sub setup_masq() warning_message "COMMENT ignored -- requires comment support in iptables/Netfilter"; } } else { - setup_one_masq $fullinterface, $networks, $addresses, $proto, $ports, $ipsec; + setup_one_masq $fullinterface, $networks, $addresses, $proto, $ports, $ipsec, $mark; } } diff --git a/Shorewall-perl/Shorewall/Rules.pm b/Shorewall-perl/Shorewall/Rules.pm index a3e867b17..ed2b342da 100644 --- a/Shorewall-perl/Shorewall/Rules.pm +++ b/Shorewall-perl/Shorewall/Rules.pm @@ -841,7 +841,7 @@ sub process_macro ( $$$$$$$$$$$ ) { $mrate = merge_macro_column $mrate, $rate; $muser = merge_macro_column $muser, $user; - process_rule1 $mtarget, $msource, $mdest, $mproto, $mports, $msports, $origdest, $rate, $user; + process_rule1 $mtarget, $msource, $mdest, $mproto, $mports, $msports, $origdest, $mrate, $muser; progress_message " Rule \"$line\" $done"; }