RemoteSyslogAppender remote IP issue

Hello, I'm using OROCOS version 2.6.0 (fuerte) and am having a curious issue with using the included log4cpp::RemoteSyslogAppender class. Through much research and some wiresharking, I've seen log messages getting sent via UDP on port 514 as expected, however the remote destination IP address ends up as 139.255.255.255, when it should be 139.123.123.123 (or whatever my machine is). I've traced the issue to a line of code which sets the _ipAddr member variable inside the open() function. The code in question is (where pent is a struct hostent* returned from gethostbyname() or gethostbyaddr()):


_ipAddr = *(pent->h_addr);
If I change this one line of code to the following, then the destination IP address fills in properly as expected:
_ipAddr = (struct in_addr*)pent->h_addr;
Does anyone have any insight as to why this is the case? We really would rather not have to change this underlying log4cpp code if we don't have to. Any help would be greatly appreciated. thanks, Chuck

impala454's picture

RemoteSyslogAppender remote

Let me also add that I changed the _ipAddr member variable to a struct in_addr*, and the appropriate call in the _append() function.

Ruben Smits's picture

RemoteSyslogAppender remote IP issue

Hi Charles,

On Tue, Jul 1, 2014 at 11:20 PM, <charles [dot] a [dot] claunch [..] ...> wrote:

> Hello, I'm using OROCOS version 2.6.0 (fuerte) and am having a curious
> issue
> with using the included log4cpp::RemoteSyslogAppender class. Through much
> research and some wiresharking, I've seen log messages getting sent via UDP
> on port 514 as expected, however the remote destination IP address ends up
> as
> 139.255.255.255,

I've not looked at any code or ever used the RemoteSysLogAppender but:

This looks like a broadcast address, so everyone in the same 139.x network
should be able to receive it, maybe this is how it is intended to work?

Ruben

> when it should be 139.123.123.123 (or whatever my machine
> is). I've traced the issue to a line of code which sets the _ipAddr member
> variable inside the open() function. The code in question is (where pent
> is
> a struct hostent* returned from gethostbyname() or gethostbyaddr()):
> -------
> _ipAddr = *(pent->h_addr);
> -------
> If I change this one line of code to the following, then the destination IP
> address fills in properly as expected:
> -------
> _ipAddr = (struct in_addr*)pent->h_addr;
> -------
> Does anyone have any insight as to why this is the case? We really would
> rather not have to change this underlying log4cpp code if we don't have to.
> Any help would be greatly appreciated.
> thanks,
> Chuck
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>

RemoteSyslogAppender remote IP issue

On Jul 3, 2014, at 2:41 AM, Ruben Smits <ruben [dot] smits [..] ...ruben [dot] smits [..] ...>> wrote:

Hi Charles,

On Tue, Jul 1, 2014 at 11:20 PM, <charles [dot] a [dot] claunch [..] ...charles [dot] a [dot] claunch [..] ...>> wrote:
Hello, I'm using OROCOS version 2.6.0 (fuerte) and am having a curious issue
with using the included log4cpp::RemoteSyslogAppender class. Through much
research and some wiresharking, I've seen log messages getting sent via UDP
on port 514 as expected, however the remote destination IP address ends up as
139.255.255.255,
I've not looked at any code or ever used the RemoteSysLogAppender but:

This looks like a broadcast address, so everyone in the same 139.x network should be able to receive it, maybe this is how it is intended to work?

Ruben

Chuck and I work together. We tested this theory (as that was my expectation, too). It didn’t work. My syslog server never received the messages, and my instance of Wireshark never saw the broadcasts. Granted, that could be a router/switch configuration issue. Regardless, it’s not obvious/clear why the RSLA would broadcast when it takes a host/IP as a configuration parameter. I believe Chuck’s changes more clearly implement the expectations of the user.


dustin

when it should be 139.123.123.123 (or whatever my machine
is). I've traced the issue to a line of code which sets the _ipAddr member
variable inside the open() function. The code in question is (where pent is
a struct hostent* returned from gethostbyname() or gethostbyaddr()):
-------
_ipAddr = *(pent->h_addr);
-------
If I change this one line of code to the following, then the destination IP
address fills in properly as expected:
-------
_ipAddr = (struct in_addr*)pent->h_addr;
-------
Does anyone have any insight as to why this is the case? We really would
rather not have to change this underlying log4cpp code if we don't have to.
Any help would be greatly appreciated.
thanks,
Chuck
--
Orocos-Users mailing list
Orocos-Users [..] ...<mailto:Orocos-Users [..] ...>
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

--
Ruben Smits, CTO
+32 479 511 786
Intermodalics - Kapeldreef 60, 3001 Heverlee - BELGIUM
www.intermodalics.eu<http://www.intermodalics.eu />

---------------------------------------------------------------------------------------------------------------------------------------
This email and any attached files are confidential and may be legally privileged. Any copy, print or forward of this email, without the agreement of sender or addressee, is strictly prohibited. Misuse is a violation of the law on personal data protection (D. Lgs. 196/2003) and on secrecy of correspondence (art. 616 cp). If you have received this transmission in error please notify the sender immediately and then delete this email and any attached files.
--
Orocos-Users mailing list
Orocos-Users [..] ...<mailto:Orocos-Users [..] ...>
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

impala454's picture

RemoteSyslogAppender remote IP issue

We have a patch we'd like applied to log4cpp that gives us what we feel is the designed intent of sending the log messages to a specific IP address and not broadcasting. See below
>From b665c5f6f0f9ce461bcd8d859d9e3638a5ac2032 Mon Sep 17 00:00:00 2001
From: Chuck Claunch <charles [dot] a [dot] claunch [..] ...>
Date: Tue, 8 Jul 2014 12:35:54 -0500
Subject: [PATCH] Modified IP address configuration so RemoteSyslogAppender
sends directly to the given IP address instead of
broadcasting.

---
include/log4cpp/RemoteSyslogAppender.hh | 2 +-
src/RemoteSyslogAppender.cpp | 10 ++++++++--
2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/log4cpp/RemoteSyslogAppender.hh b/include/log4cpp/RemoteSyslogAppender.hh
index 17fdf0b..faf1b31 100644

RemoteSyslogAppender remote IP issue

Hi Charles,

Could you resend the patch as attachment ? We can't apply it if it's
inlined in a markup email...

Peter

On Tue, Jul 8, 2014 at 7:44 PM, Claunch, Charles A. (JSC-ER4)[Jacobs
Technology, Inc.] <charles [dot] a [dot] claunch [..] ...> wrote:

> We have a patch we'd like applied to log4cpp that gives us what we feel
> is the designed intent of sending the log messages to a specific IP address
> and not broadcasting. See below
>
> From b665c5f6f0f9ce461bcd8d859d9e3638a5ac2032 Mon Sep 17 00:00:00 2001
>
> From: Chuck Claunch <charles [dot] a [dot] claunch [..] ...>
>
> Date: Tue, 8 Jul 2014 12:35:54 -0500
>
> Subject: [PATCH] Modified IP address configuration so RemoteSyslogAppender
>
> sends directly to the given IP address instead of
>
> broadcasting.
>
>
>
> ---
>
> include/log4cpp/RemoteSyslogAppender.hh | 2 +-
>
> src/RemoteSyslogAppender.cpp | 10 ++++++++--
>
> 2 files changed, 9 insertions(+), 3 deletions(-)
>
>
>
> diff --git a/include/log4cpp/RemoteSyslogAppender.hh b/include/log4cpp/
> RemoteSyslogAppender.hh
>
> index 17fdf0b..faf1b31 100644
>

impala454's picture

RemoteSyslogAppender remote IP issue

Yep, sorry about that. Here ya go.
-Chuck
________________________________________
From: Peter Soetens [peter [..] ...]
Sent: Wednesday, July 09, 2014 6:44 AM
To: Claunch, Charles A. (JSC-ER4)[Jacobs Technology, Inc.]
Cc: orocos-users [..] ...
Subject: Re: [Orocos-users] RemoteSyslogAppender remote IP issue

Hi Charles,

Could you resend the patch as attachment ? We can't apply it if it's inlined in a markup email...

Peter

On Tue, Jul 8, 2014 at 7:44 PM, Claunch, Charles A. (JSC-ER4)[Jacobs Technology, Inc.] <charles [dot] a [dot] claunch [..] ...charles [dot] a [dot] claunch [..] ...>> wrote:
We have a patch we'd like applied to log4cpp that gives us what we feel is the designed intent of sending the log messages to a specific IP address and not broadcasting. See below
>From b665c5f6f0f9ce461bcd8d859d9e3638a5ac2032 Mon Sep 17 00:00:00 2001
From: Chuck Claunch <charles [dot] a [dot] claunch [..] ...charles [dot] a [dot] claunch [..] ...>>
Date: Tue, 8 Jul 2014 12:35:54 -0500
Subject: [PATCH] Modified IP address configuration so RemoteSyslogAppender
sends directly to the given IP address instead of
broadcasting.

---
include/log4cpp/RemoteSyslogAppender.hh | 2 +-
src/RemoteSyslogAppender.cpp | 10 ++++++++--
2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/log4cpp/RemoteSyslogAppender.hh b/include/log4cpp/RemoteSyslogAppender.hh
index 17fdf0b..faf1b31 100644

RemoteSyslogAppender remote IP issue

On Wed, Jul 9, 2014 at 3:07 PM, Claunch, Charles A. (JSC-ER4)[Jacobs
Technology, Inc.] <charles [dot] a [dot] claunch [..] ...> wrote:
> Yep, sorry about that. Here ya go.
> -Chuck

Thanks, I've pushed your patch to master and toolchain on github.

Peter

> ________________________________________
> From: Peter Soetens [peter [..] ...]
> Sent: Wednesday, July 09, 2014 6:44 AM
> To: Claunch, Charles A. (JSC-ER4)[Jacobs Technology, Inc.]
> Cc: orocos-users [..] ...
> Subject: Re: [Orocos-users] RemoteSyslogAppender remote IP issue
>
> Hi Charles,
>
> Could you resend the patch as attachment ? We can't apply it if it's inlined in a markup email...
>
> Peter
>
>
> On Tue, Jul 8, 2014 at 7:44 PM, Claunch, Charles A. (JSC-ER4)[Jacobs Technology, Inc.] <charles [dot] a [dot] claunch [..] ...charles [dot] a [dot] claunch [..] ...>> wrote:
> We have a patch we'd like applied to log4cpp that gives us what we feel is the designed intent of sending the log messages to a specific IP address and not broadcasting. See below
> >From b665c5f6f0f9ce461bcd8d859d9e3638a5ac2032 Mon Sep 17 00:00:00 2001
> From: Chuck Claunch <charles [dot] a [dot] claunch [..] ...charles [dot] a [dot] claunch [..] ...>>
> Date: Tue, 8 Jul 2014 12:35:54 -0500
> Subject: [PATCH] Modified IP address configuration so RemoteSyslogAppender
> sends directly to the given IP address instead of
> broadcasting.
>
> ---
> include/log4cpp/RemoteSyslogAppender.hh | 2 +-
> src/RemoteSyslogAppender.cpp | 10 ++++++++--
> 2 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/include/log4cpp/RemoteSyslogAppender.hh b/include/log4cpp/RemoteSyslogAppender.hh
> index 17fdf0b..faf1b31 100644

impala454's picture

RemoteSyslogAppender remote IP issue

Great, thanks Peter! Any ETA on a new build?
________________________________________
From: Peter Soetens [peter [..] ...]
Sent: Wednesday, July 09, 2014 9:33 AM
To: Claunch, Charles A. (JSC-ER4)[Jacobs Technology, Inc.]
Cc: orocos-users [..] ...
Subject: Re: [Orocos-users] RemoteSyslogAppender remote IP issue

On Wed, Jul 9, 2014 at 3:07 PM, Claunch, Charles A. (JSC-ER4)[Jacobs
Technology, Inc.] <charles [dot] a [dot] claunch [..] ...> wrote:
> Yep, sorry about that. Here ya go.
> -Chuck

Thanks, I've pushed your patch to master and toolchain on github.

Peter

> ________________________________________
> From: Peter Soetens [peter [..] ...]
> Sent: Wednesday, July 09, 2014 6:44 AM
> To: Claunch, Charles A. (JSC-ER4)[Jacobs Technology, Inc.]
> Cc: orocos-users [..] ...
> Subject: Re: [Orocos-users] RemoteSyslogAppender remote IP issue
>
> Hi Charles,
>
> Could you resend the patch as attachment ? We can't apply it if it's inlined in a markup email...
>
> Peter
>
>
> On Tue, Jul 8, 2014 at 7:44 PM, Claunch, Charles A. (JSC-ER4)[Jacobs Technology, Inc.] <charles [dot] a [dot] claunch [..] ...charles [dot] a [dot] claunch [..] ...>> wrote:
> We have a patch we'd like applied to log4cpp that gives us what we feel is the designed intent of sending the log messages to a specific IP address and not broadcasting. See below
> >From b665c5f6f0f9ce461bcd8d859d9e3638a5ac2032 Mon Sep 17 00:00:00 2001
> From: Chuck Claunch <charles [dot] a [dot] claunch [..] ...charles [dot] a [dot] claunch [..] ...>>
> Date: Tue, 8 Jul 2014 12:35:54 -0500
> Subject: [PATCH] Modified IP address configuration so RemoteSyslogAppender
> sends directly to the given IP address instead of
> broadcasting.
>
> ---
> include/log4cpp/RemoteSyslogAppender.hh | 2 +-
> src/RemoteSyslogAppender.cpp | 10 ++++++++--
> 2 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/include/log4cpp/RemoteSyslogAppender.hh b/include/log4cpp/RemoteSyslogAppender.hh
> index 17fdf0b..faf1b31 100644