summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-09-10 10:26:06 +0000
committerErmal Luçi <eri@pfsense.org>2008-09-10 10:26:06 +0000
commit8f6f2a11dcd5dbc342449cf984067cde7c379178 (patch)
treeee8087c0cbaa8a02855f62ae7de6590f27be162e /etc
parent934240efeb45a567968df27d0ced84ed007d41c2 (diff)
downloadpfsense-8f6f2a11dcd5dbc342449cf984067cde7c379178.zip
pfsense-8f6f2a11dcd5dbc342449cf984067cde7c379178.tar.gz
Correctly return gre/gif addresses if selected on the firewall rules or needed elsewhere.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/interfaces.inc17
1 files changed, 13 insertions, 4 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index aa61ab1..1287048 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -1753,18 +1753,27 @@ function get_current_wan_address($interface = "wan") {
default:
if (isset($cfg['ispointtopoint']) && $cfg['pointtopoint']) {
/* get interface info with netstat */
- exec("/usr/bin/netstat -nWI " . escapeshellarg($realif) . " -f inet", $ifinfo
-);
+ exec("/usr/bin/netstat -nWI " . escapeshellarg($realif) . " -f inet", $ifinfo);
if (isset($ifinfo[1])) {
$aif = preg_split("/\s+/", $ifinfo[1]);
$curwanip = chop($aif[3]);
-
if ($curwanip && is_ipaddr($curwanip) && ($curwanip != "0.0.0.0"))
return $curwanip;
}
return null;
- }
+ } else if (stristr($realif, "gre")) {
+ if (is_array($config['gres']['gre']))
+ foreach ($config['gres']['gre'] as $grecfg)
+ if ($grecfg['greif'] == $realif)
+ return ($grecfg['tunnel-local-addr']);
+ } else if (stristr($realif, "gif")) {
+ if (is_array($config['gifs']['gre']))
+ foreach ($config['gifs']['gif'] as $gifcfg)
+ if ($gifcfg['gifif'] == $realif)
+ return ($gifcfg['tunnel-local-addr']);
+ }
+
break;
}
OpenPOWER on IntegriCloud