mwan3: fix IPv6 routing add handling 12814/head
authorFlorian Eckert <fe@dev.tdt.de>
Thu, 16 Jul 2020 13:08:04 +0000 (15:08 +0200)
committerAaron Goodman <aaronjg@stanford.edu>
Mon, 20 Jul 2020 03:24:13 +0000 (23:24 -0400)
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>
net/mwan3/files/lib/mwan3/mwan3.sh

index d7def8672a55936505bc0459d2f8906d11184261..3ce880fd25702b7d7fd9aa62ac8d86d8974a98f4 100644 (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"