diff options
author | jim-p <jimp@pfsense.org> | 2015-09-14 15:11:57 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2015-09-14 15:11:57 -0400 |
commit | dda80e7602bd190667aa23ce371eb8c3925f6459 (patch) | |
tree | 5254a5289b22812d87892ee20b85091f3d9c9918 /src/usr | |
parent | 2ccb418a2eec36e9d31faf495414ebeb01bf828a (diff) | |
download | pfsense-dda80e7602bd190667aa23ce371eb8c3925f6459.zip pfsense-dda80e7602bd190667aa23ce371eb8c3925f6459.tar.gz |
Fix source address selection on Test Port to handle VIPs properly.
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/local/www/diag_testport.php | 10 |
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") |