Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/route PR/42179: Christoph Badura: Be a little friendlie...



details:   https://anonhg.NetBSD.org/src/rev/d18ec56e6746
branches:  trunk
changeset: 778107:d18ec56e6746
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Mar 17 02:13:44 2012 +0000

description:
PR/42179: Christoph Badura: Be a little friendlier about missing args.

diffstat:

 sbin/route/route.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r de20071f4aff -r d18ec56e6746 sbin/route/route.c
--- a/sbin/route/route.c        Fri Mar 16 23:13:48 2012 +0000
+++ b/sbin/route/route.c        Sat Mar 17 02:13:44 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: route.c,v 1.136 2011/12/26 00:20:43 christos Exp $     */
+/*     $NetBSD: route.c,v 1.137 2012/03/17 02:13:44 christos Exp $     */
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)route.c    8.6 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: route.c,v 1.136 2011/12/26 00:20:43 christos Exp $");
+__RCSID("$NetBSD: route.c,v 1.137 2012/03/17 02:13:44 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -1031,6 +1031,10 @@
                        }
                }
        }
+       if ((rtm_addrs & RTA_DST) == 0)
+               errx(EXIT_FAILURE, "missing destination specification");
+       if (*cmd == 'a' && (rtm_addrs & RTA_GATEWAY) == 0)
+               errx(EXIT_FAILURE, "missing gateway specification");
        if (forcehost && forcenet)
                errx(EXIT_FAILURE, "-host and -net conflict");
        else if (forcehost)



Home | Main Index | Thread Index | Old Index