From 3f786367e7dfe91efbc602ba31fe39d5192117ea Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 24 Jan 2009 11:00:30 +0100 Subject: [PATCH] tcpconns plugin: Fix an endianness problem under *BSD. The port numbers were assumed to be in the host's byte order, when in fact they are in network byte order (big endian). The patch adds `ntohs' where necessary to fix this problem. Resolves: #35 --- src/tcpconns.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tcpconns.c b/src/tcpconns.c index 2e115922..ff663b80 100644 --- a/src/tcpconns.c +++ b/src/tcpconns.c @@ -506,7 +506,8 @@ static int conn_read (void) && ((inp->inp_vflag & INP_IPV6) == 0)) continue; - conn_handle_ports (inp->inp_lport, inp->inp_fport, tp->t_state); + conn_handle_ports (ntohs (inp->inp_lport), ntohs (inp->inp_fport), + tp->t_state); } /* for (in_ptr) */ in_orig = NULL; -- 2.11.0