summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-04-12 18:19:10 +0000
committerErmal <eri@pfsense.org>2013-04-12 18:19:10 +0000
commitef59836c53b000577d6b2a94cf9b822533a50b2d (patch)
tree04366a7fbbbfa6e209ded6397f633cce4d9ee446 /etc
parentd9ae755de940113f8996f290fe8420b98e6a5e9d (diff)
downloadpfsense-ef59836c53b000577d6b2a94cf9b822533a50b2d.zip
pfsense-ef59836c53b000577d6b2a94cf9b822533a50b2d.tar.gz
Run reconfiguration only for changed ip address or dynamic interface
Diffstat (limited to 'etc')
-rwxr-xr-xetc/rc.newwanip60
1 files changed, 26 insertions, 34 deletions
diff --git a/etc/rc.newwanip b/etc/rc.newwanip
index afcb09d..92d47dc 100755
--- a/etc/rc.newwanip
+++ b/etc/rc.newwanip
@@ -156,19 +156,25 @@ if(is_array($config['gifs']['gif'])){
}
}
-/* reconfigure static routes (kernel may have deleted them) */
-system_routing_configure($interface);
+/*
+ * We need to force sync VPNs on such even when the IP is the same for dynamic interfaces.
+ * Even with the same IP the VPN software is unhappy with the IP disappearing, and we
+ * could be failing back in which case we need to switch IPs back anyhow.
+ */
+if (!is_ipaddr($oldip) || $curwanip != $oldip || !is_ipaddrv4($config['interfaces'][$interface]['ipaddr'])) {
+ /* reconfigure static routes (kernel may have deleted them) */
+ system_routing_configure($interface);
-/* reconfigure our gateway monitor */
-setup_gateways_monitor();
+ /* reconfigure our gateway monitor */
+ setup_gateways_monitor();
-/* signal filter reload */
-filter_configure();
+ file_put_contents("{$g['vardb_path']}/{$interface}_cacheip", $curwanip);
+
+ /* perform RFC 2136 DNS update */
+ services_dnsupdate_process($interface);
-if (is_ipaddr($oldip) && $curwanip == $oldip) {
- /* We need to force sync VPNs on such even when the IP is the same. Even with
- * the same IP the VPN software is unhappy with the IP disappearing, and we
- * could be failing back in which case we need to switch IPs back anyhow. */
+ /* signal dyndns update */
+ services_dyndns_configure($interface);
/* reconfigure IPsec tunnels */
vpn_ipsec_force_reload($interface);
@@ -177,33 +183,19 @@ if (is_ipaddr($oldip) && $curwanip == $oldip) {
if (substr($interface_real, 0, 4) != "ovpn")
openvpn_resync_all($interface);
- exit;
-}
-
-file_put_contents("{$g['vardb_path']}/{$interface}_cacheip", $curwanip);
-
-/* perform RFC 2136 DNS update */
-services_dnsupdate_process($interface);
+ /* reload graphing functions */
+ enable_rrd_graphing();
-/* signal dyndns update */
-services_dyndns_configure($interface);
+ /* reload igmpproxy */
+ services_igmpproxy_configure();
-/* reconfigure IPsec tunnels */
-vpn_ipsec_force_reload($interface);
+ /* restart snmp */
+ services_snmpd_configure();
-/* start OpenVPN server & clients */
-if (substr($interface_real, 0, 4) != "ovpn")
- openvpn_resync_all($interface);
-
-/* reload graphing functions */
-enable_rrd_graphing();
-
-/* reload igmpproxy */
-services_igmpproxy_configure();
-
-/* restart snmp */
-services_snmpd_configure();
+ restart_packages();
+}
-restart_packages();
+/* signal filter reload */
+filter_configure();
?>
OpenPOWER on IntegriCloud