]> git.ipfire.org Git - people/ms/network.git/commitdiff
ip-tunnel: Fix protocol detection when local address is empty
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 17 Sep 2018 13:25:55 +0000 (15:25 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 17 Sep 2018 13:25:55 +0000 (15:25 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.ip-tunnel

index 3baf280f03d2e729e2f003560ef6bf004cc44422..38164896309044de6bc8d28e8da46b7872c3e893 100644 (file)
@@ -109,8 +109,8 @@ ip_tunnel_add() {
        fi
 
        # We cannot mix IPv6 and IPv4
-       if [[ "${remote_address_protocol}" != \
-               "$(ip_detect_protocol "${local_address}")" ]] ; then
+       if isset local_address && \
+                       [[ "${remote_address_protocol}" != "$(ip_detect_protocol "${local_address}")" ]] ; then
                log ERROR "Local and remote address\
                        are not from the same IP protocol"
                return ${EXIT_ERROR}