Skip to content

Commit

Permalink
Print partial UDP packet hex dump
Browse files Browse the repository at this point in the history
  • Loading branch information
ruti committed Jan 14, 2025
1 parent a6c84a7 commit 57046d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions desync.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 57046d5

Please sign in to comment.