mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-16 19:30:44 +01:00
Fix for macro handling of rate and user
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6178 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
37d7ef0ba6
commit
15c8f371b1
@ -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' ) {
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user