mwan3: fix IPv6 routing add handling

This fixes routing handling. Introduced with the last version update.
The following message disappears on the shell
when mwan3 is called with 'mwna3 restart`.

`Error: Invalid gateway address.`

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
[aaronjg@stanford.edu: fully unset variable and handle ipv4 as well]
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
(cherry picked from commit 8e3e6f8dde)
This commit is contained in:
Florian Eckert 2020-07-16 15:08:04 +02:00
parent 447d51edbf
commit 2c89e14c31

View file

@ -518,6 +518,8 @@ mwan3_create_iface_route()
network_get_gateway${V_} via "$1"
fi
( [ -z "$via" ] || [ "$via" = "0.0.0.0" ] || [ "$via" = "::" ] ) && unset via
network_get_metric metric "$1"
$IP route flush table "$id"