summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--etc/inc/system.inc2
-rwxr-xr-xetc/rc.newwanip5
2 files changed, 6 insertions, 1 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 964004d..292770d 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -383,6 +383,8 @@ function system_routing_configure($interface = "") {
if (isset($gateways_arr[$rtent['gateway']])) {
$gatewayip = $gateways_arr[$rtent['gateway']]['gateway'];
$interfacegw = $gateways_arr[$rtent['gateway']]['interface'];
+ if ($interface == $gateways_arr[$rtent['gateway']]['friendlyiface'])
+ continue;
} else if (is_ipaddr($rtent['gateway'])) {
$gatewayip = $rtent['gateway'];
} else {
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