Print partial UDP packet hex dump

This commit is contained in:
ruti 2025-01-14 14:37:34 +03:00
parent a6c84a762e
commit 57046d51b3
2 changed files with 5 additions and 1 deletions

View File

@ -626,6 +626,10 @@ ssize_t desync_udp(int sfd, char *buffer,
{
struct desync_params *dp = &params.dp[dp_c];
if (params.debug) {
INIT_HEX_STR(buffer, (n > 16 ? 16 : n));
LOG(LOG_S, "bytes: %s (%zd)\n", HEX_STR, n);
}
if (dp->udp_fake_count != 0) {
struct packet pkt;
if (dp->fake_data.data) {

2
main.c
View File

@ -805,7 +805,7 @@ int main(int argc, char **argv)
#else
val = strtol(optarg, &end, 0);
#endif
if (val <= 0 || val > UINT_MAX || *end)
if (val <= 0 || val > (long)UINT_MAX || *end)
invalid = 1;
else
params.timeout = val;