Subject: | Global variable $host gets undefined value when calling setlogsock without port number |
Date: | Wed, 11 Oct 2017 10:55:37 +0300 |
To: | bug-Sys-Syslog [...] rt.cpan.org |
From: | Janne Redsven <janne [...] open.com.au> |
In setlogsock there is $mechanism{$sock_type}{check}->() (line 362), which in case for TCP and UDP sets global variable $host = $syslog_path (line 288) if $sock_port is not defined and getservbyname is succesful. However in global variables section $syslog_path is 'path for "stream" and "unix" mechanisms' so it not (and shouldn't be?) defined when using TCP or UDP as connection method.
So it seems that when using TCP or UDP and calling setlogsock() without port, $host is undefined after socket type mechanism check and therefore connect_udp/tcp defaults to localhost's syslog port?
BR,
Janne