]> git.ipfire.org Git - people/ms/network.git/commitdiff
route: Check if the dection of the protocol failed
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Tue, 30 May 2017 08:35:44 +0000 (10:35 +0200)
committerJonatan Schlag <jonatan.schlag@ipfire.org>
Tue, 30 May 2017 08:35:44 +0000 (10:35 +0200)
If the check of the protocol failed we should break.

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
src/functions/functions.route

index 640c8713aafbc457a0c22679ca9b29f229f7f242..4759684c9fcfec0b473f3396e4264c52fc956b50 100644 (file)
@@ -97,7 +97,10 @@ route_add() {
                fi
 
                local network_proto=$(ip_detect_protocol ${network})
+               assert isset network_proto
+
                local gateway_proto=$(ip_detect_protocol ${gateway})
+               assert isset gateway_proto
 
                if [ "${network_proto}" != "${gateway_proto}" ]; then
                        error "The IP protocol version of the given network and gateway did not match."