diff options
author | Roger Dingledine <arma@torproject.org> | 2003-09-21 06:44:53 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2003-09-21 06:44:53 +0000 |
commit | 9fe1ed26ff97668845707adef1eb7aad155ec9be (patch) | |
tree | 8eb19a2392995da9c444e3bbfe46c16c8b513993 /src/or/buffers.c | |
parent | ed51df7453b51ac5263fcc43f46cea26022d17da (diff) | |
download | tor-9fe1ed26ff97668845707adef1eb7aad155ec9be.tar.gz tor-9fe1ed26ff97668845707adef1eb7aad155ec9be.zip |
get network/host order working right again for socks4
svn:r476
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r-- | src/or/buffers.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c index 7a7bd1fad4..087998d28c 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -281,8 +281,8 @@ int fetch_from_buf_socks(char *buf, int *buf_datalen, /* an inlined socks4_unpack() */ socks4_info.version = *buf; socks4_info.command = *(buf+1); - socks4_info.destport = *(uint16_t*)(buf+2); - socks4_info.destip = *(uint32_t*)(buf+4); + socks4_info.destport = ntohs(*(uint16_t*)(buf+2)); + socks4_info.destip = ntohl(*(uint32_t*)(buf+4)); if(socks4_info.version != 4) { log_fn(LOG_NOTICE,"Unrecognized version %d.",socks4_info.version); @@ -294,7 +294,7 @@ int fetch_from_buf_socks(char *buf, int *buf_datalen, return -1; } - port = ntohs(socks4_info.destport); + port = socks4_info.destport; if(!port) { log_fn(LOG_NOTICE,"Port is zero."); return -1; |