FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "EPRT", null));
return;
}
// get data server
InetAddress dataAddr = null;
try {
dataAddr = InetAddress.getByName(host);
} catch (UnknownHostException ex) {
LOG.debug("Unknown host: " + host, ex);
session
.write(LocalizedFtpReply
.translate(
session,
request,
context,
FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS,
"EPRT.host", null));
return;
}
// check IP
if (dataCfg.isActiveIpCheck()) {
if (session.getRemoteAddress() instanceof InetSocketAddress) {
InetAddress clientAddr = ((InetSocketAddress) session
.getRemoteAddress()).getAddress();
if (!dataAddr.equals(clientAddr)) {
session.write(LocalizedFtpReply.translate(session, request,
context, FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "EPRT.mismatch", null));
return;