[BusyBox] Patch for libbb/xconnect.c
Joel Coltoff
joel at wmi.com
Fri Jul 19 11:23:03 UTC 2002
On Fri, 19 Jul 2002, Stewart Brodie wrote:
> meant, but your patch is right anyway (although it looks back-to-front - does
> patch catch that properly?)
Oops! No it doesn't. Sorry about that For those who don't want to
do reverse patches here it is the right way.
--- libbb/xconnect.c Fri Jul 19 13:20:03 2002
+++ libbb/xconnect.c.new Fri Jul 19 12:43:23 2002
@@ -57,7 +57,7 @@
struct sockaddr_in s_addr;
int s = socket(AF_INET, SOCK_STREAM, 0);
struct servent *tserv;
- int port_nr=atoi(port);
+ int port_nr=htons(atoi(port));
struct hostent * he;
if (port_nr==0 && (tserv = getservbyname(port, "tcp")) != NULL)
@@ -65,7 +65,7 @@
memset(&s_addr, 0, sizeof(struct sockaddr_in));
s_addr.sin_family = AF_INET;
- s_addr.sin_port = htons(port_nr);
+ s_addr.sin_port = port_nr;
he = xgethostbyname(host);
memcpy(&s_addr.sin_addr, he->h_addr, sizeof s_addr.sin_addr);
--
Joel Coltoff
We often think that when we have completed our study of one we know all
about two, because "two" is "one and one." We forget that we still have
to make a study of "and."
-- Sir Arthur Eddington
More information about the busybox
mailing list