Hello me again, just showing what kind of change apparently would be needed if it was patched to logread.c source.
--- log/logread.c
+++ log/logread.c
@@ -79,10 +79,20 @@
static void log_handle_reconnect(struct uloop_timeout *timeout)
{
+ int yes = 1;
+
sender.fd = usock((log_udp) ? (USOCK_UDP) : (USOCK_TCP), log_ip, log_port);
if (sender.fd < 0) {
uloop_timeout_set(&retry, 1000);
return;
+ }
+
+ /* Salli broadcast-lähetys vain UDP-moodissa, jos kohde on broadcast-osoite */
+ if (log_udp && log_ip) {
+ struct in_addr addr;
+ if (inet_aton(log_ip, &addr) && addr.s_addr == INADDR_BROADCAST) {
+ setsockopt(sender.fd, SOL_SOCKET, SO_BROADCAST, &yes, sizeof(yes));
+ }
}
sender.cb = log_handle_fd;
I don’t currently have build environment and I got this tentative change if someone have time and willingness to test it using Google search AI-mode, thus it’s vibe-coded caveat emptor! (But looks actually quite good, I’ve been writing quite bit C past years). I got this change by asking:
"Hi,
Could you tell me how to add the ability to send syslog messages (UDP/514) to a locally connected subnet's broadcast address using the `-r` option in the following Linux `logread.c` code: https://git.openwrt.org/project/ubox/tree/log/logread.c? Specifically, should the `SO_BROADCAST` option be added using `setsockopt()`?
In this modification, it would be good to ensure that `SO_BROADCAST` is not set unnecessarily when the target IP address is not a broadcast address. If you can help with this, I would appreciate seeing either the modified code or the changes in `diff -u` format."
But Tobias, if we think about this simple looking change what it would mean for Teltonika a moment if they would test and if good apply it. Then it would create them a continuous burden going forward to each time they possibly would take new version from OpenWRT to remember reapply all the changes what then have made locally.
That burden could be avoided if this kind of patch, once working as expected, would be approved and migrated to upstream OpenWRT source and from there downstream without worrying in future if you remember to add all local changes.
@Justinas don’t take this me pushing this to you so that I would expect you to do anything I’ve written here. RutOS is your product and all I was trying to accomplish was to find out reasons (use case) why someone would rather have broadcast syslog messages to subnet and then why it didn’t work after all. Then I thought heck I’ll find why it doesn’t work and once I knew then asking it from these coding capable LLM’s wasn’t much of effort from my part. I hope you don’t get me wrong. If you do, I’m sorry and just DM me what bugs you and I’ll never do that again.
Cheers,
riku
ps. Google LLM answered me in Finnish as that was my language setting in browser. You can translate those comments trivially asking same LLM to translate those in english 
ps2: code seems to be just for global broadcast target 255.255.255.255, but Google search LLM will help also if asked to modify code further so that it will apply to interface subnet broadcast. Just write prompt to ask it and that’s it.