diff options
author | Ermal Luçi <ermal.luci@gmail.com> | 2012-12-19 12:46:27 -0800 |
---|---|---|
committer | Ermal Luçi <ermal.luci@gmail.com> | 2012-12-19 12:46:27 -0800 |
commit | a33b69dbd9a6682c452ef509a30340ca4e69646b (patch) | |
tree | be9e3817a0085b9166cbf84a6abfd62f309fdb36 /etc | |
parent | 15fc311fc4236bdcf618e93a74bd606e293a2e01 (diff) | |
parent | 13b31977f7268517c5e53dc4cd768c477c98786f (diff) | |
download | pfsense-a33b69dbd9a6682c452ef509a30340ca4e69646b.zip pfsense-a33b69dbd9a6682c452ef509a30340ca4e69646b.tar.gz |
Merge pull request #287 from bcyrill/alias_gif
Add IP alias support to GIF interfaces
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/interfaces.inc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index d30b137..55ca41f 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -834,13 +834,19 @@ function interface_gif_configure(&$gif, $gifkey = "") { return -1; $realif = get_real_interface($gif['if']); + $ipaddr = $gif['ipaddr']; - if(is_ipaddrv4($gif['remote-addr'])) { - $realifip = get_interface_ip($gif['if']); + if (is_ipaddrv4($gif['remote-addr'])) { + if (is_ipaddrv4($ipaddr)) + $realifip = $ipaddr; + else + $realifip = get_interface_ip($gif['if']); $realifgw = get_interface_gateway($gif['if']); - } - if(is_ipaddrv6($gif['remote-addr'])) { - $realifip = get_interface_ipv6($gif['if']); + } else if (is_ipaddrv6($gif['remote-addr'])) { + if (is_ipaddrv6($ipaddr)) + $realifip = $ipaddr; + else + $realifip = get_interface_ipv6($gif['if']); $realifgw = get_interface_gatewayv6($gif['if']); } /* make sure the parent interface is up */ |