aboutsummaryrefslogtreecommitdiff
path: root/tests/ftpserver.pl
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2007-09-17 21:39:34 +0000
committerDan Fandrich <dan@coneharvesters.com>2007-09-17 21:39:34 +0000
commit0ed57d370d5fa183f573c54167d57b4cd909eea1 (patch)
treee0df78b9f5ad5d29432b038a7a8b07a1fadc96bc /tests/ftpserver.pl
parent551abba2777507ed0dea728c013c05deaefc35cf (diff)
Allow setting the IP address on which to listen for connections.
Diffstat (limited to 'tests/ftpserver.pl')
-rw-r--r--tests/ftpserver.pl8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index a5b474f5c..c5268ca13 100644
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -82,6 +82,7 @@ my $ipv6;
my $ext; # append to log/pid file names
my $grok_eprt;
my $port = 8921; # just a default
+my $listenaddr = "127.0.0.1"; # just a default
my $pidfile = ".ftpd.pid"; # a default, use --pidfile
do {
@@ -109,6 +110,10 @@ do {
$port = $ARGV[1];
shift @ARGV;
}
+ elsif($ARGV[0] eq "--addr") {
+ $listenaddr = $ARGV[1];
+ shift @ARGV;
+ }
} while(shift @ARGV);
sub catch_zap {
@@ -569,7 +574,8 @@ sub PASV_command {
if($cmd ne "EPSV") {
# PASV reply
- my $p="127,0,0,1";
+ my $p=$listenaddr;
+ $p =~ s/\./,/g;
if($pasvbadip) {
$p="1,2,3,4";
}