Traditionally, active FTP data connections come from port-1 (4558 by default).
Even though firewalls now don't usually rely on that, but do active control connection
inspection to find ports being used, let's try and be as nice as we can to
non FTP-aware firewalls.
This was subtracting 1 before the bites swap, causing it to be 4303 on little
endian machines.
Noticed by Amin Mozafari.
#endif
/* anchor socket to avoid multi-homing problems */
data_source = ctrl_addr;
- Socket::port(data_source) = htons(ntohs(Socket::port(ctrl_addr)-1));
+ Socket::port(data_source) = htons(ntohs(Socket::port(ctrl_addr))-1);
#ifdef F_SETOWN
if (fcntl(fd, F_SETOWN, getpid()) == -1)
logError("fcntl (F_SETOWN): %m");