Improve UDP payload logging

This commit is contained in:
Vadim Vetrov 2024-11-29 21:43:27 +03:00
parent 3a5dbff8ac
commit cb138b902a
No known key found for this signature in database
GPG Key ID: E8A308689D7A73A5

View File

@ -339,11 +339,14 @@ int process_udp_packet(const struct section_config_t *section, const uint8_t *pk
}
if (dlen > 10 && config.verbose >= VERBOSE_TRACE) {
lginfo("UDP payload start: [ ");
char buf[50];
char *bufpt = buf;
bufpt += sprintf(bufpt, "UDP payload start: [ ");
for (int i = 0; i < 10; i++) {
lginfo("%02x ", data[i]);
bufpt += sprintf(bufpt, "%02x ", data[i]);
}
lginfo("], ");
bufpt += sprintf(bufpt, "]");
lgtrace_addp("%s", buf);
}