[syslinux:firmware] pxe, ftp: Don' t convert an IP address to host byte order

syslinux-bot for H. Peter Anvin hpa at linux.intel.com
Sat Aug 31 22:06:03 PDT 2013


Commit-ID:  3e86c0e35b96fef58dbfbb96e3ef509ea4047d2e
Gitweb:     http://www.syslinux.org/commit/3e86c0e35b96fef58dbfbb96e3ef509ea4047d2e
Author:     H. Peter Anvin <hpa at linux.intel.com>
AuthorDate: Sat, 31 Aug 2013 22:01:20 -0700
Committer:  H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Sat, 31 Aug 2013 22:01:20 -0700

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 at linux.intel.com>

---
 core/fs/pxe/ftp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/fs/pxe/ftp.c b/core/fs/pxe/ftp.c
index 06c232e..4327e45 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;


More information about the Syslinux-commits mailing list