From ddb30ebfc686165e00f0155e00df16edc17c31c5 Mon Sep 17 00:00:00 2001 From: Ermal Date: Fri, 28 Feb 2014 13:37:31 +0000 Subject: [PATCH] Fixes #3484. Provide a dynamic gateway for gif v6 tunnels so it can be used on firewall rules etc. The guide for setting up this tunnels on docs need to change to leave the gif interface as none type. People upgrading need to fix this themselves with a not on release notes. This can be fixed if the kernel condition is relaxed to allow setting the prefixlen on the tunnel as ipv4 --- etc/inc/gwlb.inc | 4 +++- etc/inc/interfaces.inc | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 9fd73d72cb..7cb83ae0dd 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -555,6 +555,8 @@ function return_gateways_array($disabled = false, $localhost = false) { default: if (substr($ifcfg['if'], 0, 4) == "ovpn") $ctype = "VPNv6"; + else if (substr($ifcfg['if'], 0, 3) == "gif") + $ctype = "TUNNELv6"; break; } $ctype = "_". strtoupper($ctype); @@ -879,7 +881,7 @@ function get_interface_gateway($interface, &$dynamic = false) { if (!is_ipaddrv4($gw) && !is_ipaddrv4($gwcfg['ipaddr'])) { $realif = get_real_interface($interface); if (file_exists("{$g['tmp_path']}/{$realif}_router")) { - $gw = trim(file_get_contents("{$g['tmp_path']}/{$realif}_router"), " \n"); + $gw = trim(file_get_contents("{$g['tmp_path']}/{$realif}_router"), " \n"); $dynamic = true; } if (file_exists("{$g['tmp_path']}/{$realif}_defaultgw")) diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 7f138152de..9e67450fee 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -4641,6 +4641,8 @@ function interface_has_gatewayv6($friendly) { default: if (substr($ifname['if'], 0, 4) == "ovpn") return true; + if (substr($ifname['if'], 0, 3) == "gif") + return true; if (!empty($ifname['gatewayv6'])) return true; break;