summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-07-16 16:31:34 -0300
committerRenato Botelho <garga@FreeBSD.org>2013-07-16 16:34:47 -0300
commiteb8e0aa9d60fbd2b504ba1b33cf6b2cb17d59649 (patch)
tree9e16b0b94f5479f6380165cc8f19d5ca1e1e393f
parente4a0be9bee26f71da33e1fa4fca41f597fda2dbd (diff)
downloadpfsense-eb8e0aa9d60fbd2b504ba1b33cf6b2cb17d59649.zip
pfsense-eb8e0aa9d60fbd2b504ba1b33cf6b2cb17d59649.tar.gz
Call interface_ipalias_cleanup() after $interface is initialized, and get current IP after it
-rwxr-xr-xetc/rc.newwanip12
1 files changed, 8 insertions, 4 deletions
diff --git a/etc/rc.newwanip b/etc/rc.newwanip
index 5b3c483..cdeb4d2 100755
--- a/etc/rc.newwanip
+++ b/etc/rc.newwanip
@@ -46,9 +46,6 @@ require_once("rrd.inc");
if($g['booting'])
exit;
-/* NOTE: Check #2495 before being smart here */
-interface_ipalias_cleanup($interface, "inet4");
-
function restart_packages() {
global $oldip, $curwanip, $g;
@@ -65,12 +62,19 @@ $argument = str_replace("\n", "", $argv[1]);
log_error("rc.newwanip: Informational is starting {$argument}.");
if(empty($argument)) {
- $curwanip = get_interface_ip();
$interface = "wan";
$interface_real = get_real_interface();
} else {
$interface = convert_real_interface_to_friendly_interface_name($argument);
$interface_real = $argument;
+}
+
+/* NOTE: Check #2495 before being smart here */
+interface_ipalias_cleanup($interface, "inet4");
+
+if(empty($argument))
+ $curwanip = get_interface_ip();
+else {
$curwanip = find_interface_ip($interface_real, true);
if($curwanip == "")
$curwanip = get_interface_ip($interface);
OpenPOWER on IntegriCloud