Ticket #4544: 0002-Add-QoS-firewall-stop-script-generation.patch

File 0002-Add-QoS-firewall-stop-script-generation.patch, 1.6 KB (added by kevin@…, 7 years ago)

Patch to add QoS firewall stop script generation

  • package/qos-scripts/files/usr/bin/qos-stop

    From 3874b55955d1ecb783f3320d631aaf82065b1ec2 Mon Sep 17 00:00:00 2001
    From: Kevin Locke <klocke@digitalenginesoftware.com>
    Date: Tue, 26 Apr 2011 13:48:03 -0600
    Subject: [PATCH 2/2] Add QoS firewall stop script generation
    
    To prevent code duplication for clearing QoS firewall rules, support
    "firewall stop" arguments to generate.sh to generate the necessary
    script commands.  Make use of this from qos-stop.
    
    Signed-off-by: Kevin Locke <klocke@digitalenginesoftware.com>
    ---
     package/qos-scripts/files/usr/bin/qos-stop        |    3 +--
     package/qos-scripts/files/usr/lib/qos/generate.sh |    9 ++++++++-
     2 files changed, 9 insertions(+), 3 deletions(-)
    
    diff --git a/package/qos-scripts/files/usr/bin/qos-stop b/package/qos-scripts/files/usr/bin/qos-stop
    index d0243be..7f654d8 100755
    a b for iface in $(tc qdisc show | grep -E '(hfsc|ingress)' | awk '{print $5}'); do 
    33        tc qdisc del dev "$iface" ingress 2>&- >&- 
    44        tc qdisc del dev "$iface" root 2>&- >&- 
    55done 
    6 iptables -t mangle -F 
    7 iptables -t mangle -X 
     6/usr/lib/qos/generate.sh firewall stop | sh 
  • package/qos-scripts/files/usr/lib/qos/generate.sh

    diff --git a/package/qos-scripts/files/usr/lib/qos/generate.sh b/package/qos-scripts/files/usr/lib/qos/generate.sh
    index 093967f..a983d15 100755
    a b case "$1" in 
    486486                start_interfaces 
    487487        ;; 
    488488        firewall) 
    489                 start_firewall 
     489                case "$2" in 
     490                        stop) 
     491                                stop_firewall 
     492                        ;; 
     493                        start|"") 
     494                                start_firewall 
     495                        ;; 
     496                esac 
    490497        ;; 
    491498esac