Skip to content

Commit

Permalink
Emit better message for not supported type in redudp
Browse files Browse the repository at this point in the history
  • Loading branch information
semigodking committed Nov 26, 2023
1 parent 72d17ef commit 699babb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion redudp.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,6 @@ static int redudp_onexit(parser_section *section)
err = "no `type` for redudp";
}


if (instance->config.max_pktqueue == 0) {
parser_error(section->context, "max_pktqueue must be greater than 0.");
return -1;
Expand All @@ -579,6 +578,9 @@ static int redudp_onexit(parser_section *section)
return -1;
}

if (err)
parser_error(section->context, "%s", err);

return err?-1:0;
}

Expand Down
4 changes: 3 additions & 1 deletion utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,9 @@ int resolve_hostname(const char *hostname, int sa_family, struct sockaddr *addr)
return 0;
}
else {
log_errno(LOG_ERR, "Unable to resolve hostname: %s", hostname);
log_errno(LOG_INFO, "Unable to resolve hostname (%s): %s",
sa_family == AF_INET6 ? "IPv6": "IPv4",
hostname);
return -1;
}
}
Expand Down

0 comments on commit 699babb

Please sign in to comment.