Skip to content

Instantly share code, notes, and snippets.

@rbgarga
Created October 28, 2013 21:28
Show Gist options
  • Save rbgarga/7205159 to your computer and use it in GitHub Desktop.
Save rbgarga/7205159 to your computer and use it in GitHub Desktop.
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 012b288..92b90f3 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -483,6 +483,8 @@ function return_gateways_array($disabled = false, $localhost = false) {
default:
if (substr($ifcfg['if'], 0, 4) == "ovpn")
$ctype = "VPNv4";
+ else if (substr($ifcfg['if'], 0, 3) == "gre")
+ $ctype = "GREv4";
break;
}
$ctype = "_". strtoupper($ctype);
@@ -553,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) == "gre")
+ $ctype = "GREv6";
break;
}
$ctype = "_". strtoupper($ctype);
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 7178a61..8694a19 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -4622,7 +4622,7 @@ function get_interfaces_with_gateway() {
$ints[$ifdescr] = $ifdescr;
break;
default:
- if (substr($ifname['if'], 0, 4) == "ovpn" ||
+ if (preg_match('/^(ovpn|gre)/', $ifname['if']) ||
!empty($ifname['gateway']))
$ints[$ifdescr] = $ifdescr;
break;
@@ -4646,7 +4646,7 @@ function interface_has_gateway($friendly) {
return true;
break;
default:
- if (substr($ifname['if'], 0, 4) == "ovpn")
+ if (preg_match('/^(ovpn|gre)/', $ifname['if']))
return true;
if (!empty($ifname['gateway']))
return true;
@@ -4671,7 +4671,7 @@ function interface_has_gatewayv6($friendly) {
return true;
break;
default:
- if (substr($ifname['if'], 0, 4) == "ovpn")
+ if (preg_match('/^(ovpn|gre)/', $ifname['if']))
return true;
if (!empty($ifname['gatewayv6']))
return true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment