summaryrefslogtreecommitdiffstats
path: root/etc/rc.newwanip
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:31:34 -0300
commitde8f0075636459515025a25a22a47d8803aff75e (patch)
tree31e58c02313ccec73806be9b48d7db3225c632b6 /etc/rc.newwanip
parent8ff9cc387b124f01cf12c61519bc0999968639f9 (diff)
downloadpfsense-de8f0075636459515025a25a22a47d8803aff75e.zip
pfsense-de8f0075636459515025a25a22a47d8803aff75e.tar.gz
Call interface_ipalias_cleanup() after $interface is initialized, and get current IP after it
Diffstat (limited to 'etc/rc.newwanip')
-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