When destination parameter is missing, exit with a clear synopsis,

instead of writing to kernel and printing EINVAL description.

PR:		bin/181532
Submitted by:	Kurt Jaeger <fbsd-pr opsec.eu>
Approved by:	re (hrs)
This commit is contained in:
Gleb Smirnoff 2013-10-08 08:16:17 +00:00
parent e590690fad
commit 3bf351b29a

View File

@ -928,6 +928,11 @@ newroute(int argc, char **argv)
}
}
if (so[RTAX_DST].ss_len == 0) {
warnx("destination parameter required");
usage(NULL);
}
if (nrflags & F_FORCEHOST) {
nrflags |= F_ISHOST;
#ifdef INET6