summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/local/www/diag_testport.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/usr/local/www/diag_testport.php b/src/usr/local/www/diag_testport.php
index 3b7cf5a..4fe9c4f 100644
--- a/src/usr/local/www/diag_testport.php
+++ b/src/usr/local/www/diag_testport.php
@@ -139,7 +139,15 @@ if ($_POST || $_REQUEST['host']) {
/* Attempt to determine the interface address, if possible. Else try both. */
if (is_ipaddrv4($host)) {
- $ifaddr = ($sourceip == "any") ? "" : get_interface_ip($sourceip);
+ if ($sourceip == "any") {
+ $ifaddr = "";
+ } else {
+ if (is_ipaddr($sourceip)) {
+ $ifaddr = $sourceip;
+ } else {
+ $ifaddr = get_interface_ip($sourceip);
+ }
+ }
$nc_args .= ' -4';
} elseif (is_ipaddrv6($host)) {
if ($sourceip == "any")
OpenPOWER on IntegriCloud