[syslog-ng]syslog-ng 1.5.14 released
Balazs Scheidler
bazsi@balabit.hu
Tue, 5 Feb 2002 16:36:41 +0100
On Tue, Feb 05, 2002 at 04:12:32PM +0100, Gert Menke wrote:
> Hi, Balazs!
>
> Thanks for applying my patches! I see that you have beautified my code a
> little. Maybe you made a mistake, though. In affile.c:
>
> ---8<--- cut here -----
> case M_SOURCE_IP:
> if (msg->saddr) {
> CAST(inet_address_info, addr, msg->saddr);
> char *ip;
>
> ip = inet_ntoa(addr->sa.sin_addr);
> length = append_string(dest, left, ip, strlen(ip), escape);
> break;
> }
> case M_HOST: {
> ---8<--- cut here -----
>
> Since the break is inside the if block, the hostname will be inserted when
> there is no source ip. While this is better than nothing, wouldn't it be
> even better to insert a string like "127.0.0.1" ?
> Can I safely assume that a missing source ip means that the mesage comes
> from localhost?
you are right, I applied the patches in a hurry, and I made a mistake. I
originally meant to insert nothing if it comes from the localhost, though
inserting "127.0.0.1" might be even better.
--
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1