[syslog-ng]Syslog-NG 1.6.6 memory leak when sending UDP logs
syslog-ng@lists.balabit.hu
syslog-ng@lists.balabit.hu
Fri, 4 Mar 2005 13:56:32 -0500
This is a multipart message in MIME format.
--=_alternative 006866A385256FBA_=
Content-Type: text/plain; charset="US-ASCII"
>There is no version 1.2.2, the latest version is 1.1.2.1 (or 1.1.3 which
>is BETA)
My bad, (typo) 1.1.2(.1) to be specific.
>This patch fixes the byte order issue, and I'm still hunting the memory
>leak with your configuration:
>
>diff -u -r1.25.4.6 afinet.c
>--- afinet.c 5 Aug 2004 11:35:12 -0000 1.25.4.6
>+++ afinet.c 3 Mar 2005 12:26:47 -0000
>@@ -617,11 +617,10 @@
> ADDRESS2SOCKADDR(msg->saddr, sizeof(src_addr),
(struct sockaddr *) &src_addr);
> ADDRESS2SOCKADDR(self->super.dest_addr,
sizeof(dst_addr), (struct sockaddr *) >&dst_addr);
>
>-
> libnet_clear_packet(self->lnet_ctx);
>
>- udp = libnet_build_udp(src_addr.sin_port,
>- dst_addr.sin_port,
>+ udp = libnet_build_udp(ntohs(src_addr.sin_port),
>+ ntohs(dst_addr.sin_port),
> LIBNET_UDP_H +
msg_line->length,
> 0,
> msg_line->data,
I applied the patch, and recompiled. You are not going to beleive this:
Data is STILL getting to the destination properly - despite the ntohs
function.
Yes, I checked the binary to be certain it recompiled, and threw a printf
statement in there to be certain.
It would seem that the ntohs function has no effect.
--=_alternative 006866A385256FBA_=
Content-Type: text/html; charset="US-ASCII"
<br><font size=2><tt>>There is no version 1.2.2, the latest version
is 1.1.2.1 (or 1.1.3 which<br>
>is BETA)<br>
</tt></font>
<br><font size=2><tt>My bad, (typo) 1.1.2(.1) to be specific. </tt></font>
<br>
<br><font size=2><tt><br>
>This patch fixes the byte order issue, and I'm still hunting the memory<br>
>leak with your configuration:<br>
><br>
>diff -u -r1.25.4.6 afinet.c<br>
>--- afinet.c 5 Aug 2004 11:35:12 -0000
1.25.4.6<br>
>+++ afinet.c 3 Mar 2005 12:26:47 -0000<br>
>@@ -617,11 +617,10 @@<br>
>
ADDRESS2SOCKADDR(msg->saddr, sizeof(src_addr), (struct
sockaddr *) &src_addr);<br>
>
ADDRESS2SOCKADDR(self->super.dest_addr, sizeof(dst_addr),
(struct sockaddr *) >&dst_addr);<br>
><br>
>-<br>
>
libnet_clear_packet(self->lnet_ctx);<br>
><br>
>-
udp = libnet_build_udp(src_addr.sin_port,<br>
>-
dst_addr.sin_port,<br>
>+
udp = libnet_build_udp(ntohs(src_addr.sin_port),<br>
>+
ntohs(dst_addr.sin_port),<br>
>
LIBNET_UDP_H + msg_line->length,<br>
>
0,<br>
>
msg_line->data,<br>
<br>
I applied the patch, and recompiled. You are not going to beleive this:</tt></font>
<br><font size=2><tt>Data is STILL getting to the destination properly
- despite the ntohs function. </tt></font>
<br><font size=2><tt>Yes, I checked the binary to be certain it recompiled,
and threw a printf statement in there to be certain. </tt></font>
<br><font size=2><tt>It would seem that the ntohs function has no effect.
</tt></font>
<br>
<br>
--=_alternative 006866A385256FBA_=--