diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/gwlb.inc | 3 | ||||
-rw-r--r-- | etc/inc/interfaces.inc | 9 |
2 files changed, 8 insertions, 4 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 7cb83ae..0a81a23 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -553,9 +553,10 @@ function return_gateways_array($disabled = false, $localhost = false) { $ctype = strtoupper($ifcfg['ipaddrv6']); break; default: + $tunnelif = substr($ifname['if'], 0, 3); if (substr($ifcfg['if'], 0, 4) == "ovpn") $ctype = "VPNv6"; - else if (substr($ifcfg['if'], 0, 3) == "gif") + else if ($tunnelif == "gif" || $tunnelif == "gre") $ctype = "TUNNELv6"; break; } diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 9e67450..d97a4c4 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -859,7 +859,9 @@ function interface_gre_configure(&$gre, $grekey = "") { /* Do not change the order here for more see gre(4) NOTES section. */ mwexec("/sbin/ifconfig {$greif} tunnel {$realifip} " . escapeshellarg($gre['remote-addr'])); if((is_ipaddrv6($gre['tunnel-local-addr'])) || (is_ipaddrv6($gre['tunnel-remote-addr']))) { - mwexec("/sbin/ifconfig {$greif} inet6 " . escapeshellarg($gre['tunnel-local-addr']) . " " . escapeshellarg($gre['tunnel-remote-addr']) . " prefixlen /" . escapeshellarg($gre['tunnel-remote-net'])); + /* XXX: The prefixlen argument for tunnels of ipv6 is useless since it needs to be 128 as enforced by kernel */ + //mwexec("/sbin/ifconfig {$greif} inet6 " . escapeshellarg($gre['tunnel-local-addr']) . " " . escapeshellarg($gre['tunnel-remote-addr']) . " prefixlen /" . escapeshellarg($gre['tunnel-remote-net'])); + mwexec("/sbin/ifconfig {$greif} inet6 " . escapeshellarg($gre['tunnel-local-addr']) . " " . escapeshellarg($gre['tunnel-remote-addr']) . " prefixlen 128"); } else { mwexec("/sbin/ifconfig {$greif} " . escapeshellarg($gre['tunnel-local-addr']) . " " . escapeshellarg($gre['tunnel-remote-addr']) . " netmask " . gen_subnet_mask($gre['tunnel-remote-net'])); } @@ -953,7 +955,7 @@ function interface_gif_configure(&$gif, $gifkey = "") { if((is_ipaddrv6($gif['tunnel-local-addr'])) || (is_ipaddrv6($gif['tunnel-remote-addr']))) { /* XXX: The prefixlen argument for tunnels of ipv6 is useless since it needs to be 128 as enforced by kernel */ //mwexec("/sbin/ifconfig {$gifif} inet6 " . escapeshellarg($gif['tunnel-local-addr']) . " " . escapeshellarg($gif['tunnel-remote-addr']) . " prefixlen /" . escapeshellarg($gif['tunnel-remote-net'])); - mwexec("/sbin/ifconfig {$gifif} inet6 " . escapeshellarg($gif['tunnel-local-addr']) . " " . escapeshellarg($gif['tunnel-remote-addr'])); + mwexec("/sbin/ifconfig {$gifif} inet6 " . escapeshellarg($gif['tunnel-local-addr']) . " " . escapeshellarg($gif['tunnel-remote-addr']) . " prefixlen 128"); } else { mwexec("/sbin/ifconfig {$gifif} " . escapeshellarg($gif['tunnel-local-addr']) . " " . escapeshellarg($gif['tunnel-remote-addr']) . " netmask " . gen_subnet_mask($gif['tunnel-remote-net'])); } @@ -4641,7 +4643,8 @@ function interface_has_gatewayv6($friendly) { default: if (substr($ifname['if'], 0, 4) == "ovpn") return true; - if (substr($ifname['if'], 0, 3) == "gif") + $tunnelif = substr($ifname['if'], 0, 3); + if ($tunnelif == "gif" || $tunnelif == "gre") return true; if (!empty($ifname['gatewayv6'])) return true; |