diff options
author | Chris Buechler <cmb@pfsense.org> | 2015-03-05 23:49:14 -0600 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2015-03-05 23:49:14 -0600 |
commit | df966626606fe7c60c3d7301f3843280b746a7a6 (patch) | |
tree | d417cd842ca766fcb9e7eb66dc3beaa9983efae4 /etc/inc/interfaces.inc | |
parent | 6021c6f9513372f03f52a61c6d021b68eb75debd (diff) | |
download | pfsense-df966626606fe7c60c3d7301f3843280b746a7a6.zip pfsense-df966626606fe7c60c3d7301f3843280b746a7a6.tar.gz |
Destroy stf interface when 6rd or 6to4 tunnel is disabled. Fixes #4471
Diffstat (limited to 'etc/inc/interfaces.inc')
-rw-r--r-- | etc/inc/interfaces.inc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index c27958a..850b213 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1318,9 +1318,15 @@ function interface_bring_down($interface = "wan", $destroy = false, $ifacecfg = case "6to4": $realif = "{$interface}_stf"; if (does_interface_exist("$realif")) { - $ip6 = get_interface_ipv6($interface); - if (is_ipaddrv6($ip6)) { - mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet6 {$ip6} delete", true); + /* destroy stf interface if tunnel is being disabled or tunnel type is being changed */ + if (($ifcfg['ipaddrv6'] == '6rd' && (!isset($config['interfaces'][$interface]['ipaddrv6']) || $config['interfaces'][$interface]['ipaddrv6'] != '6rd')) || + ($ifcfg['ipaddrv6'] == '6to4' && (!isset($config['interfaces'][$interface]['ipaddrv6']) || $config['interfaces'][$interface]['ipaddrv6'] != '6to4'))) { + $destroy = true; + } else { + /* get_interface_ipv6() returns empty value if interface is being disabled */ + $ip6 = get_interface_ipv6($interface); + if (is_ipaddrv6($ip6)) + mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet6 {$ip6} delete", true); } interface_ipalias_cleanup($interface, "inet6"); if ($destroy == true) { |