netjack2: do some sanity checks on the MTU

It needs to be large enough foer the header, udp overhead and a uint32_t
for each audio channel to be able to send the sync packet.

Avoid string oob read when debugging the packet.
This commit is contained in:
Wim Taymans 2026-05-04 10:13:44 +02:00
parent 5a8a3b5a54
commit 67b70c8d23
2 changed files with 7 additions and 1 deletions

View file

@ -133,7 +133,7 @@ struct nj2_packet_header {
static inline void nj2_dump_packet_header(struct nj2_packet_header *header)
{
pw_log_info("Type: %s", header->type);
pw_log_info("Type: %.*s", (int)sizeof(header->type), header->type);
pw_log_info("Data Type: %c", ntohl(header->data_type));
pw_log_info("Data Stream: %c", ntohl(header->data_stream));
pw_log_info("ID: %u", ntohl(header->id));