Subject: | no access to source address |
The source address of messages is unavailable if it can't be resolved. The 'host' attribute of
messages is also set to an arbitrary string if resolution fails.
Subject: | addr.patch |
--- /usr/local/lib/perl5/site_perl/5.10.1/POE/Component/Server/Syslog/UDP.pm 2009-05-28 04:34:51.000000000 -0400
+++ lib/POE/Component/Server/Syslog/UDP.pm 2011-02-17 07:15:01.249948940 -0500
@@ -120,13 +120,11 @@
while( ($records = $_[HEAP]->{filter}->get_one()) and (@$records > 0)) {
if(defined $records and ref $records eq 'ARRAY') {
foreach my $record (@$records) {
- if( ( sockaddr_in( $remote_socket ) )[1]) {
- $record->{host} = gethostbyaddr(
- ( sockaddr_in( $remote_socket ) )[1],
- AF_INET,
- );
- } else {
- $record->{host} = '[unknown]';
+ if (my $addr = (sockaddr_in($remote_socket))[1]) {
+ $record->{addr} = inet_ntoa($addr);
+ if (my $host = gethostbyaddr($addr, AF_INET)) {
+ $record->{host} = $host;
+ }
}
$_[KERNEL]->yield( 'client_input', $record );
@@ -300,9 +298,13 @@
The "severity" number decoded from the pri.
+=item * addr
+
+The remote address of the source in dotted-decimal notation.
+
=item * host
-The host that sent the message.
+The hostname of the source, if available.
=item * msg