* s6-socklog with -i ipport option
@ 2024-08-06 18:37 Jan Kämpe
2024-08-08 20:22 ` jkampe
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kämpe @ 2024-08-06 18:37 UTC (permalink / raw)
To: supervision
[-- Attachment #1: Type: text/plain, Size: 510 bytes --]
The clientip_clientport output seem incorrect in s6-socklog output when
using "-i ipport" option.
Example to reproduce; run
$ s6-socklog -i 192.168.21.1:10514
Then send test syslog message to s6-socklog listening on the UDP port
(here using "logger" on x86_64 debian linux)
$ logger -n 192.168.21.1 -P 10514 "Sample log message"
The (start of) s6-socklog produced log line "clientip_clientport" looks
(usually) something like this:
5511368.21.1_: user.notice:
Can anyone else try to re-produce/confirm?
-J
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: s6-socklog with -i ipport option
2024-08-06 18:37 s6-socklog with -i ipport option Jan Kämpe
@ 2024-08-08 20:22 ` jkampe
2024-08-09 1:48 ` Laurent Bercot
0 siblings, 1 reply; 3+ messages in thread
From: jkampe @ 2024-08-08 20:22 UTC (permalink / raw)
To: supervision; +Cc: supervision
[-- Attachment #1: Type: text/plain, Size: 837 bytes --]
Replying to myself after looking at the code ;)
Seems ip address gets overwritten with port number while formatting the ip_port string.
Maybe fix it with something like attached patch.
-Jan
On Tue, 6 Aug 2024 21:37:43 +0300
Jan Kämpe <jkampe68@gmail.com> wrote:
> The clientip_clientport output seem incorrect in s6-socklog output when
> using "-i ipport" option.
> Example to reproduce; run
> $ s6-socklog -i 192.168.21.1:10514
>
> Then send test syslog message to s6-socklog listening on the UDP port
> (here using "logger" on x86_64 debian linux)
> $ logger -n 192.168.21.1 -P 10514 "Sample log message"
>
> The (start of) s6-socklog produced log line "clientip_clientport" looks
> (usually) something like this:
> 5511368.21.1_: user.notice:
>
> Can anyone else try to re-produce/confirm?
>
> -J
[-- Attachment #2: 001-fix-socklog-ipaddr-fmt.patch --]
[-- Type: text/x-diff, Size: 672 bytes --]
diff -up s6-2.13.0.0/src/daemontools-extras/s6-socklog.c.orig s6-2.13.0.0/src/daemontools-extras/s6-socklog.c
--- s6-2.13.0.0/src/daemontools-extras/s6-socklog.c.orig 2024-08-08 21:45:07.257448848 +0300
+++ s6-2.13.0.0/src/daemontools-extras/s6-socklog.c 2024-08-08 21:46:02.416505236 +0300
@@ -194,7 +194,7 @@ int main (int argc, char const *const *a
char fmt[IP46_FMT + UINT16_FMT + 3] ;
size_t m = ip46_fmt(fmt, &ip) ;
fmt[m++] = '_' ;
- m += uint16_fmt(fmt, port) ;
+ m += uint16_fmt(&fmt[m], port) ;
fmt[m++] = ':' ; fmt[m++] = ' ' ;
buffer_putnoflush(&b1, fmt, m) ;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: s6-socklog with -i ipport option
2024-08-08 20:22 ` jkampe
@ 2024-08-09 1:48 ` Laurent Bercot
0 siblings, 0 replies; 3+ messages in thread
From: Laurent Bercot @ 2024-08-09 1:48 UTC (permalink / raw)
To: jkampe, supervision
Yeah, sorry for not getting back to you earlier. This week has
been... something.
Problem reproduced and confirmed, and your fix is a good one,
I applied something similar (fmt+m instead of &fmt[m], just personal
preference).
Thanks! The release is probably not coming soon because I'm working
on something and would like to keep things in sync, but if there are
enough bugs that a bugfix release is warranted I can cut one this
month.
--
Laurent
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-08-09 1:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-06 18:37 s6-socklog with -i ipport option Jan Kämpe
2024-08-08 20:22 ` jkampe
2024-08-09 1:48 ` Laurent Bercot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).