diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-12-04 09:15:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-04 09:15:31 +0100 |
commit | e34724a8fdf1fb73a40da8483df1322597588e2b (patch) | |
tree | 2a594b8e2d7ca3dcbd3b3887c81078194102ee2c | |
parent | bbf2b2f06b7a0f883f7134df5e2b3e089015738e (diff) | |
parent | 6391325271be489d29f0b7aa2982952068c6a53c (diff) | |
download | vyatta-cfg-qos-e34724a8fdf1fb73a40da8483df1322597588e2b.tar.gz vyatta-cfg-qos-e34724a8fdf1fb73a40da8483df1322597588e2b.zip |
Merge pull request #8 from jack9603301/current
mirror: T3089: Delete the mirror function in this module and prepare for migration
-rwxr-xr-x | scripts/vyatta-qos.pl | 22 | ||||
-rw-r--r-- | templates/interfaces/ethernet/node.tag/mirror/node.def | 18 |
2 files changed, 11 insertions, 29 deletions
diff --git a/scripts/vyatta-qos.pl b/scripts/vyatta-qos.pl index b8b1779..3a9a3cc 100755 --- a/scripts/vyatta-qos.pl +++ b/scripts/vyatta-qos.pl @@ -111,7 +111,7 @@ sub list_policy { my %delcmd = ( 'out' => 'root', - 'in' => 'parent ffff:', + 'in' => 'parent fffe:', ); ## delete_interface('eth0') @@ -160,13 +160,13 @@ sub apply_openvpn_action { die "Unknown interface type: $dev" unless $interface; # Clear existing ingress - system("/sbin/tc qdisc del dev $dev parent ffff: 2>/dev/null"); + system("/sbin/tc qdisc del dev $dev parent fffe: 2>/dev/null"); - system("/sbin/tc qdisc add dev $dev handle ffff: ingress") == 0 + system("/sbin/tc qdisc add dev $dev handle fffe: ingress") == 0 or die "tc qdisc ingress failed"; my $cmd = - "/sbin/tc filter add dev $dev parent ffff:" + "/sbin/tc filter add dev $dev parent fffe:" . " protocol all prio 10 u32" . " match u32 0 0 flowid 1:1" . " action mirred egress $action dev $target"; @@ -174,7 +174,7 @@ sub apply_openvpn_action { system($cmd) == 0 or die "tc action $action command failed"; - system("/sbin/tc qdisc del dev $dev parent ffff: 2>/dev/null") + system("/sbin/tc qdisc del dev $dev parent fffe: 2>/dev/null") if ($action eq '__undef'); } @@ -319,7 +319,7 @@ sub apply_action{ my $ingress = $config->returnValue('traffic-policy in'); - foreach my $action (qw(mirror redirect)) { + foreach my $action (qw(redirect)) { my $target = $config->returnValue($action); next unless $target; @@ -329,13 +329,13 @@ sub apply_action{ if ($ingress); # Clear existing ingress - system("/sbin/tc qdisc del dev $dev parent ffff: 2>/dev/null"); + system("/sbin/tc qdisc del dev $dev parent fffe: 2>/dev/null"); - system("/sbin/tc qdisc add dev $dev handle ffff: ingress") == 0 + system("/sbin/tc qdisc add dev $dev handle fffe: ingress") == 0 or die "tc qdisc ingress failed"; my $cmd = - "/sbin/tc filter add dev $dev parent ffff:" + "/sbin/tc filter add dev $dev parent fffe:" . " protocol all prio 10 u32" . " match u32 0 0 flowid 1:1" . " action mirred egress $action dev $target"; @@ -347,7 +347,7 @@ sub apply_action{ } # Drop what ever was there before... - system("/sbin/tc qdisc del dev $dev parent ffff: 2>/dev/null") + system("/sbin/tc qdisc del dev $dev parent fffe: 2>/dev/null") unless($ingress); } @@ -387,7 +387,7 @@ sub check_target { sub delete_action { foreach my $dev (@_) { - system("/sbin/tc qdisc del dev $dev parent ffff: 2>/dev/null"); + system("/sbin/tc qdisc del dev $dev parent fffe: 2>/dev/null"); } } diff --git a/templates/interfaces/ethernet/node.tag/mirror/node.def b/templates/interfaces/ethernet/node.tag/mirror/node.def deleted file mode 100644 index b67fd20..0000000 --- a/templates/interfaces/ethernet/node.tag/mirror/node.def +++ /dev/null @@ -1,18 +0,0 @@ -type: txt -help: Incoming packet mirroring destination -allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show=ethernet - -syntax:expression: $VAR(@) != $VAR(../@) ;\ - "interface $VAR(../@): mirroring to same interface not allowed" -val_help: Interface for packet mirroring - -commit:expression: $VAR(../redirect) == ""; \ - "interface $VAR(../@) : can not do both redirect and mirror" - -commit:expression: $VAR(../traffic-policy/in) == ""; \ - "interface $VAR(../@) : can not use ingress policy and mirror" - -commit:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --dev $VAR(@) --check=all" - -update: /opt/vyatta/sbin/vyatta-qos.pl --update-action $VAR(../@) -delete: /opt/vyatta/sbin/vyatta-qos.pl --delete-action $VAR(../@) |