diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2013-08-31 22:01:20 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2013-08-31 22:01:20 -0700 |
commit | 3e86c0e35b96fef58dbfbb96e3ef509ea4047d2e (patch) | |
tree | 5447bebb88dbb185c3956ecfb78669a6d241936f | |
parent | 4f2d3e62b61ebe21498844c0ca346482aca118c9 (diff) | |
download | syslinux-3e86c0e35b96fef58dbfbb96e3ef509ea4047d2e.tar.gz syslinux-3e86c0e35b96fef58dbfbb96e3ef509ea4047d2e.tar.xz syslinux-3e86c0e35b96fef58dbfbb96e3ef509ea4047d2e.zip |
pxe, ftp: Don't convert an IP address to host byte order
FTP passes an IP address and port number as decimal string encoded
comma-separated octets. The first four are the IP number and the
second two the port. We consider port numbers as ordinary integers
and they should be in host byte order when passed into
core_tcp_connect(), but IP addresses are simply kept in network byte
order at all times and thus should not be converted.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r-- | core/fs/pxe/ftp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/fs/pxe/ftp.c b/core/fs/pxe/ftp.c index 06c232e6..4327e45c 100644 --- a/core/fs/pxe/ftp.c +++ b/core/fs/pxe/ftp.c @@ -249,7 +249,7 @@ void ftp_open(struct url_info *url, int flags, struct inode *inode, err = core_tcp_open(socket); if (err) goto err_disconnect; - err = core_tcp_connect(socket, ntohl(*(uint32_t*)&pasv_data[0]), + err = core_tcp_connect(socket, *(uint32_t*)&pasv_data[0], ntohs(*(uint16_t *)&pasv_data[4])); if (err) goto err_disconnect; |