openbsd-ports/net/oidentd/patches/patch-oidentd_openbsd30_c
2002-05-14 01:01:48 +00:00

43 lines
1.3 KiB
Plaintext

$OpenBSD: patch-oidentd_openbsd30_c,v 1.1 2002/05/14 01:01:48 naddy Exp $
--- src/kernel/openbsd30.c.orig Sat Dec 29 17:30:25 2001
+++ src/kernel/openbsd30.c Tue May 14 02:46:30 2002
@@ -42,6 +42,7 @@
#include <netinet/ip_var.h>
#include <netinet/tcp_timer.h>
#include <netinet/tcp_var.h>
+#include <arpa/inet.h>
#ifdef MASQ_SUPPORT
# include <sys/ioctl.h>
@@ -144,12 +145,12 @@ int masq( int sock,
sin_setv4(natlook.rsaddr.v4.s_addr, &ss);
if (opt_enabled(FORWARD)) {
- ret = fwd_request(sock, fport, lport, natlook.rsaddr.v4.s_addr, &ss);
+ ret = fwd_request(sock, ntohs(fport), ntohs(lport), natlook.rsaddr.v4.s_addr, &ss);
if (ret == 0)
return(0);
debug("Forward to %s (%d %d) failed.",
- inet_ntoa(natlook.rsaddr.v4.s_addr), lport, rsport);
+ inet_ntoa(natlook.rsaddr.v4), ntohs(lport), ntohs(natlook.rsport));
}
ret = find_masq_entry(&ss, user, sizeof(user), os, sizeof(os));
@@ -157,13 +158,13 @@ int masq( int sock,
char ipbuf[MAX_IPLEN];
sockprintf(sock, "%d , %d : USERID : %s : %s\r\n",
- lport, fport, os, user);
+ ntohs(lport), ntohs(fport), os, user);
get_ip(faddr, ipbuf, sizeof(ipbuf));
o_log(NORMAL,
"[%s] (NAT) Successful lookup: %d , %d : %s",
- ipbuf, lport, fport, user);
+ ipbuf, ntohs(lport), ntohs(fport), user);
return (0);
}