From f6461410c2b573fc43d4179a48229130a8f796cd Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 18 Mar 2013 10:31:48 -0300 Subject: Avoid trying to remove an invalid IP --- etc/rc.newwanipv6 | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/etc/rc.newwanipv6 b/etc/rc.newwanipv6 index 5fd9c30..8204af1 100755 --- a/etc/rc.newwanipv6 +++ b/etc/rc.newwanipv6 @@ -131,18 +131,20 @@ setup_gateways_monitor(); /* signal filter reload */ filter_configure(); -if (is_ipaddr($oldipv6) && $curwanipv6 == $oldipv6) { - // Still need to sync VPNs on PPPoE and such, as even with the same IP the VPN software is unhappy with the IP disappearing. - if (in_array($config['interfaces'][$interface]['ipaddrv6'], array('pppoe', 'pptp', 'ppp'))) { - /* reconfigure IPsec tunnels */ - vpn_ipsec_force_reload(); - - /* start OpenVPN server & clients */ - openvpn_resync_all($interface); - } - exit; -} else - mwexec("/sbin/ifconfig {$interface_real} inet6 {$oldipv6} delete"); +if (is_ipaddrv6($oldipv6)) { + if ($curwanipv6 == $oldipv6) { + // Still need to sync VPNs on PPPoE and such, as even with the same IP the VPN software is unhappy with the IP disappearing. + if (in_array($config['interfaces'][$interface]['ipaddrv6'], array('pppoe', 'pptp', 'ppp'))) { + /* reconfigure IPsec tunnels */ + vpn_ipsec_force_reload(); + + /* start OpenVPN server & clients */ + openvpn_resync_all($interface); + } + exit; + } else + mwexec("/sbin/ifconfig {$interface_real} inet6 {$oldipv6} delete"); +} file_put_contents("{$g['vardb_path']}/{$interface}_cacheipv6", $curwanipv6); -- cgit v1.1