Make oom check consistent, check and correct overlong payload size

This commit is contained in:
HD Moore 2013-08-17 10:20:17 -05:00
parent cfdbe3bbc2
commit 8aac1ccc52
1 changed files with 7 additions and 0 deletions

View File

@ -50,6 +50,8 @@ int udp_global_initialize(struct state_conf * zconf) {
return(0);
args = strdup(zconf->probe_args);
if (! args) exit(1)
c = strchr(args, ':');
if (! c) {
fprintf(stderr, "error: unknown UDP probe specification (expected file:/path, text:STRING, or hex:01020304)\n");
@ -96,6 +98,11 @@ int udp_global_initialize(struct state_conf * zconf) {
exit(1);
}
if (udp_send_msg_len > 1472) {
fprintf(stderr, "warning: reducing UDP payload to 1472 bytes (from %d) to fit on the wire\n", udp_send_msg_len);
udp_send_msg_len = 1472;
}
free(args);
return(0);
}