mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-20 09:47:51 +02:00
Preserve shell variables when converting tcrules->mangle
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
1b82dedb77
commit
c5b393a074
@ -5139,7 +5139,7 @@ sub process_tc_rule( ) {
|
|||||||
my ( $originalmark, $source, $dest, $protos, $ports, $sports, $user, $testval, $length, $tos , $connbytes, $helper, $headers, $probability , $dscp , $state );
|
my ( $originalmark, $source, $dest, $protos, $ports, $sports, $user, $testval, $length, $tos , $connbytes, $helper, $headers, $probability , $dscp , $state );
|
||||||
if ( $family == F_IPV4 ) {
|
if ( $family == F_IPV4 ) {
|
||||||
( $originalmark, $source, $dest, $protos, $ports, $sports, $user, $testval, $length, $tos , $connbytes, $helper, $probability, $dscp, $state ) =
|
( $originalmark, $source, $dest, $protos, $ports, $sports, $user, $testval, $length, $tos , $connbytes, $helper, $probability, $dscp, $state ) =
|
||||||
split_line2( 'tcrules file',
|
split_rawline2( 'tcrules file',
|
||||||
{ mark => 0,
|
{ mark => 0,
|
||||||
action => 0,
|
action => 0,
|
||||||
source => 1,
|
source => 1,
|
||||||
@ -5162,7 +5162,7 @@ sub process_tc_rule( ) {
|
|||||||
$headers = '-';
|
$headers = '-';
|
||||||
} else {
|
} else {
|
||||||
( $originalmark, $source, $dest, $protos, $ports, $sports, $user, $testval, $length, $tos , $connbytes, $helper, $headers, $probability, $dscp, $state ) =
|
( $originalmark, $source, $dest, $protos, $ports, $sports, $user, $testval, $length, $tos , $connbytes, $helper, $headers, $probability, $dscp, $state ) =
|
||||||
split_line2( 'tcrules file',
|
split_rawline2( 'tcrules file',
|
||||||
{ mark => 0,
|
{ mark => 0,
|
||||||
action => 0,
|
action => 0,
|
||||||
source => 1,
|
source => 1,
|
||||||
|
@ -2337,7 +2337,24 @@ sub setup_tc( $ ) {
|
|||||||
#
|
#
|
||||||
( $mangle, $fn1 ) = open_mangle_for_output( $fn );
|
( $mangle, $fn1 ) = open_mangle_for_output( $fn );
|
||||||
|
|
||||||
directive_callback( sub () { print $mangle "$_[1]\n" unless $_[0] eq 'FORMAT'; 0; } );
|
directive_callback(
|
||||||
|
sub ()
|
||||||
|
{
|
||||||
|
if ( $_[0] eq 'OMITTED' ) {
|
||||||
|
#
|
||||||
|
# Convert the raw rule
|
||||||
|
#
|
||||||
|
if ( $rawcurrentline =~ /^\s*(?:#.*)?$/ ) {
|
||||||
|
print $mangle "$_[1]\n";
|
||||||
|
} else {
|
||||||
|
process_tc_rule;
|
||||||
|
$have_tcrules++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print $mangle "$_[1]\n" unless $_[0] eq 'FORMAT';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
first_entry(
|
first_entry(
|
||||||
sub {
|
sub {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user