summaryrefslogtreecommitdiffstats
path: root/etc/rc.newwanip
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-09-17 13:38:01 +0000
committerErmal <eri@pfsense.org>2010-09-17 13:38:01 +0000
commitb746dc61ec4e6e6e43467189ccaf0e1a9aee9b11 (patch)
treec40484356d2b3ff43686d039bad6a860f93dda3e /etc/rc.newwanip
parentb829290395954c43ec242d7f45bd1dd8258bbfb6 (diff)
downloadpfsense-b746dc61ec4e6e6e43467189ccaf0e1a9aee9b11.zip
pfsense-b746dc61ec4e6e6e43467189ccaf0e1a9aee9b11.tar.gz
on newip event reload the static routes for that interface because on dynamic gateways the ip might have changed. While here make sure the interface argument is repsected on system_routing_configure() and use send_event to reconfigure an interface to aleviate a possible race.
Diffstat (limited to 'etc/rc.newwanip')
-rwxr-xr-xetc/rc.newwanip5
1 files changed, 4 insertions, 1 deletions
diff --git a/etc/rc.newwanip b/etc/rc.newwanip
index 57c48bd..7030b85 100755
--- a/etc/rc.newwanip
+++ b/etc/rc.newwanip
@@ -63,7 +63,7 @@ log_error("rc.newwanip: on (IP address: {$curwanip}) (interface: {$interface}) (
if($curwanip == "0.0.0.0" || !is_ipaddr($curwanip)) {
log_error("rc.newwanip: Failed to update {$interface} IP, restarting...");
- interface_configure($interface);
+ send_event("interface reconfigure {$inerface}");
exit;
}
@@ -81,6 +81,9 @@ file_put_contents("{$g['vardb_path']}/{$interface}_cacheip", $curwanip);
if (is_ipaddr($oldip) && $curwanip == $oldip)
exit;
+/* reconfigure static routes (kernel may have deleted them) */
+system_routing_configure($interface);
+
/* reconfigure our gateway monitor */
setup_gateways_monitor();
OpenPOWER on IntegriCloud