qosmngr: improve l2 classification logic

I noticed that there is a potential improvement in the way the
ebtables rules are generated from the UCI file. The thing is,
a restart of the firewall does not flush the ebtables, so, the
ebtables have to flushed by adding the ebtables -t broute -F
command in the firewall.qos (or any other script) to remove the
rules generated by firewall.qos. This also flushes the rule that
directed the lookup of the qos chain. Now, to the rule to lookup
qos chain needs to be manually added which I think is not the best
thing to do. The qosmngr should be independent in this regard, hence,
this improvement.
This commit is contained in:
Rahul 2020-08-26 16:41:55 +05:30
parent de9a7c447d
commit c1e7c8f103

View file

@ -90,7 +90,12 @@ handle_shaper() {
setup_qos() {
ebtables -t broute -N qos
ret=$?
[ $ret -eq 0 ] && ebtables -t broute -I BROUTING -j qos
if [ $ret -eq 0 ]; then
ebtables -t broute -I BROUTING -j qos
else
ebtables -t broute -D BROUTING -j qos
ebtables -t broute -I BROUTING -j qos
fi
iptables -t mangle -N qos_forward
ret=$?