aboutsummaryrefslogtreecommitdiff
path: root/sbin/route/route.c
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2013-10-08 08:16:17 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2013-10-08 08:16:17 +0000
commit3bf351b29a026b91740a411c4f0d5e85901e4e2a (patch)
tree4d61a5cd0ca271961e2e601fdc5c7949a04d45c0 /sbin/route/route.c
parente590690fad2b243bb68ee101d6a4857130053e5e (diff)
downloadsrc-3bf351b29a026b91740a411c4f0d5e85901e4e2a.tar.gz
src-3bf351b29a026b91740a411c4f0d5e85901e4e2a.zip
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)
Notes
Notes: svn path=/head/; revision=256137
Diffstat (limited to 'sbin/route/route.c')
-rw-r--r--sbin/route/route.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index e575c711329f..6c2bbe2084b2 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -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