diff options
-rw-r--r-- | usr/local/www/diag_testport.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/usr/local/www/diag_testport.php b/usr/local/www/diag_testport.php index b64075e..902e1e2 100644 --- a/usr/local/www/diag_testport.php +++ b/usr/local/www/diag_testport.php @@ -201,7 +201,15 @@ include("head.inc"); ?> /* 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") |