mirror of
https://repo.or.cz/socat.git
synced 2024-12-23 07:52:32 +00:00
info message during socks connect showed bad port number on little endian systems
This commit is contained in:
parent
0c8f8a7fc0
commit
27eb0a30b6
2 changed files with 8 additions and 3 deletions
4
CHANGES
4
CHANGES
|
@ -15,6 +15,10 @@ corrections:
|
||||||
Debian bug 531078: socat execs children with SIGCHLD ignored; corrected
|
Debian bug 531078: socat execs children with SIGCHLD ignored; corrected
|
||||||
to default. Thanks to Martin Dorey for reporting this bug.
|
to default. Thanks to Martin Dorey for reporting this bug.
|
||||||
|
|
||||||
|
info message during socks connect showed bad port number on little
|
||||||
|
endian systems due to wrong byte order (thanks to Peter M. Galbavy for
|
||||||
|
bug report and patch)
|
||||||
|
|
||||||
docu mentions option so-bindtodev but correct name is so-bindtodevice.
|
docu mentions option so-bindtodev but correct name is so-bindtodevice.
|
||||||
Thanks to Jim Zimmerman for reporting.
|
Thanks to Jim Zimmerman for reporting.
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* source: xio-socks.c */
|
/* source: xio-socks.c */
|
||||||
/* Copyright Gerhard Rieger 2001-2009 */
|
/* Copyright Gerhard Rieger 2001-2012 */
|
||||||
/* Published under the GNU General Public License V.2, see file COPYING */
|
/* Published under the GNU General Public License V.2, see file COPYING */
|
||||||
|
|
||||||
/* this file contains the source for opening addresses of socks4 type */
|
/* this file contains the source for opening addresses of socks4 type */
|
||||||
|
@ -257,7 +257,8 @@ int _xioopen_socks4_prepare(const char *targetport, struct opt *opts, char **soc
|
||||||
/* generate socks header - points to final target */
|
/* generate socks header - points to final target */
|
||||||
sockhead->version = 4;
|
sockhead->version = 4;
|
||||||
sockhead->action = 1;
|
sockhead->action = 1;
|
||||||
sockhead->port = parseport(targetport, IPPROTO_TCP);
|
sockhead->port = parseport(targetport, IPPROTO_TCP); /* network byte
|
||||||
|
order */
|
||||||
|
|
||||||
if (retropt_string(opts, OPT_SOCKSPORT, socksport) < 0) {
|
if (retropt_string(opts, OPT_SOCKSPORT, socksport) < 0) {
|
||||||
if ((se = getservbyname("socks", "tcp")) != NULL) {
|
if ((se = getservbyname("socks", "tcp")) != NULL) {
|
||||||
|
@ -358,7 +359,7 @@ int _xioopen_socks4_connect(struct single *xfd,
|
||||||
}
|
}
|
||||||
Info11("sending socks4%s request VN=%d DC=%d DSTPORT=%d DSTIP=%d.%d.%d.%d USERID=%s%s%s",
|
Info11("sending socks4%s request VN=%d DC=%d DSTPORT=%d DSTIP=%d.%d.%d.%d USERID=%s%s%s",
|
||||||
destdomname?"a":"",
|
destdomname?"a":"",
|
||||||
sockhead->version, sockhead->action, sockhead->port,
|
sockhead->version, sockhead->action, ntohs(sockhead->port),
|
||||||
((unsigned char *)&sockhead->dest)[0],
|
((unsigned char *)&sockhead->dest)[0],
|
||||||
((unsigned char *)&sockhead->dest)[1],
|
((unsigned char *)&sockhead->dest)[1],
|
||||||
((unsigned char *)&sockhead->dest)[2],
|
((unsigned char *)&sockhead->dest)[2],
|
||||||
|
|
Loading…
Reference in a new issue