1 diff -Nur a/redir.c b/redir.c
2 --- a/redir.c 1999-12-26 15:50:06.000000000 -0500
3 +++ b/redir.c 2005-10-22 21:29:55.491735272 -0400
7 debug1("peer IP is %s\n", inet_ntoa(client.sin_addr));
8 - debug1("peer socket is %d\n", client.sin_port);
9 + debug1("peer socket is %d\n", ntohs(client.sin_port));
12 * Double fork here so we don't have to wait later
14 strcpy(tmp2, inet_ntoa(target->sin_addr));
16 syslog(LOG_NOTICE, "connecting %s/%d to %s/%d",
17 - tmp1, client.sin_port,
18 - tmp2, target->sin_port);
19 + tmp1, ntohs(client.sin_port),
20 + tmp2, ntohs(target->sin_port));
26 if (!getpeername(0, (struct sockaddr *) &client, &client_size)) {
27 debug1("peer IP is %s\n", inet_ntoa(client.sin_addr));
28 - debug1("peer socket is %d\n", client.sin_port);
29 + debug1("peer socket is %d\n", ntohs(client.sin_port));
31 if ((targetsock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
32 perror("target: socket");
36 syslog(LOG_NOTICE, "connecting %s/%d to %s/%d",
37 - inet_ntoa(client.sin_addr), client.sin_port,
38 - target_ip, target.sin_port);
39 + inet_ntoa(client.sin_addr), ntohs(client.sin_port),
40 + target_ip, ntohs(target.sin_port));
43 /* Just start copying - one side of the loop is stdin - 0 */