diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2002-06-03 19:30:50 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2002-06-03 19:30:50 +0000 |
commit | c0c3e2c19ba15a8d0c650139773656d2e85b2122 (patch) | |
tree | 36e41311cbf152346c96541bb118f20f43ff0b32 /usr.sbin | |
parent | 315effa9514fd1ddc57aa790d3eca372075da72e (diff) |
recover backward compatibility in -I behavior. sync w/kame
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ndp/ndp.8 | 21 | ||||
-rw-r--r-- | usr.sbin/ndp/ndp.c | 21 |
2 files changed, 21 insertions, 21 deletions
diff --git a/usr.sbin/ndp/ndp.8 b/usr.sbin/ndp/ndp.8 index be50b23ff95..b7a6a36fd7b 100644 --- a/usr.sbin/ndp/ndp.8 +++ b/usr.sbin/ndp/ndp.8 @@ -1,5 +1,5 @@ -.\" $OpenBSD: ndp.8,v 1.14 2002/06/03 04:44:50 itojun Exp $ -.\" $KAME: ndp.8,v 1.26 2002/06/03 04:39:03 itojun Exp $ +.\" $OpenBSD: ndp.8,v 1.15 2002/06/03 19:30:49 itojun Exp $ +.\" $KAME: ndp.8,v 1.27 2002/06/03 19:25:27 itojun Exp $ .\" .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. .\" All rights reserved. @@ -65,10 +65,7 @@ .Op Ar flags ... .Nm ndp .Op Fl nt -.Fl I Ar interface -.Nm ndp -.Op Fl nt -.Fl I Li delete +.Fl I Op Ar interface | Li delete .Nm ndp .Op Fl nt .Fl s Ar nodename etheraddr @@ -144,15 +141,15 @@ Parse the file specified by .It Fl H Harmonize consistency between the routing table and the default router list; install the top entry of the list into the kernel routing table. +.It Fl I +Shows the default interface used as the default route when +there is no default router. .It Fl I Ar interface -Shows or specifies the default interface used as the default route when +Specifies the default interface used as the default route when there is no default router. -If a valid -.Ar interface -is specified, the interface will be used as the default. -If +The .Ar interface -is not a valid interface name, the current setting will be presented. +will be used as the default. .It Fl I Li delete The current default interface will be deleted from the kernel. .It Fl i Ar interface Op Ar flags ... diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index 1a5e98c45c6..3c33dc4307e 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ndp.c,v 1.23 2002/06/03 04:44:50 itojun Exp $ */ -/* $KAME: ndp.c,v 1.99 2002/06/03 04:39:03 itojun Exp $ */ +/* $OpenBSD: ndp.c,v 1.24 2002/06/03 19:30:49 itojun Exp $ */ +/* $KAME: ndp.c,v 1.100 2002/06/03 19:25:27 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. @@ -175,7 +175,7 @@ main(argc, argv) pid = getpid(); thiszone = gmt2local(0); - while ((ch = getopt(argc, argv, "acd:f:I:i:nprstA:HPR")) != -1) + while ((ch = getopt(argc, argv, "acd:f:Ii:nprstA:HPR")) != -1) switch (ch) { case 'a': case 'c': @@ -185,6 +185,7 @@ main(argc, argv) case 'P': case 'R': case 's': + case 'I': if (mode) { usage(); /*NOTREACHED*/ @@ -194,7 +195,6 @@ main(argc, argv) break; case 'd': case 'f': - case 'I': case 'i' : if (mode) { usage(); @@ -246,12 +246,16 @@ main(argc, argv) break; case 'I': #ifdef SIOCSDEFIFACE_IN6 /* XXX: check SIOCGDEFIFACE_IN6 as well? */ - if (argc != 0) { + if (argc > 1) { usage(); /*NOTREACHED*/ + } else if (argc == 1) { + if (strcmp(*argv, "delete") == 0 || + if_nametoindex(*argv)) + setdefif(*argv); + else + errx(1, "invalid interface %s", *argv); } - if (strcmp(arg, "default") == 0 || if_nametoindex(arg)) - setdefif(arg); getdefif(); /* always call it to print the result */ break; #else @@ -847,8 +851,7 @@ usage() printf(" ndp [-nt] -f filename\n"); printf(" ndp [-nt] -i interface [flags...]\n"); #ifdef SIOCSDEFIFACE_IN6 - printf(" ndp [-nt] -I interface\n"); - printf(" ndp [-nt] -I delete\n"); + printf(" ndp [-nt] -I [interface|delete]\n"); #endif printf(" ndp [-nt] -s nodename etheraddr [temp] [proxy]\n"); exit(1); |