1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-16 12:23:59 +02:00
openwrt-packages/net/mwan3
Maxim Mikityanskiy 02b9af9606 mwan3: Fix awk expression in mwan3_delete_iface_rules
The awk expression in mwan3_delete_iface_rules splits the `ip rule list`
output by spaces, therefore $1 contains the trailing column (e.g., "1:",
"1000:"). The < and > operators compare such values as strings instead
of numbers, producing unexpected results (for example, "1:" > "1000").

Change the field separator to ":" for correct number comparison, so that
the right rules are removed.

An example error message that may appear before the fix:

Error: argument "1:" is wrong: preference value is invalid

It happens because `substr($1,0,4)` selects short numbers along with
the colon. In other cases wrong rules may be removed, for example, if
there is rule 10051, then rule 1005 will be removed.

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
2024-04-02 01:01:50 +03:00
..
files mwan3: Fix awk expression in mwan3_delete_iface_rules 2024-04-02 01:01:50 +03:00
src
Makefile mwan3: check removed route before removal 2024-02-20 21:53:22 +01:00