diff options
-rw-r--r-- | usr.sbin/ndp/ndp.8 | 14 | ||||
-rw-r--r-- | usr.sbin/ndp/ndp.c | 84 |
2 files changed, 4 insertions, 94 deletions
diff --git a/usr.sbin/ndp/ndp.8 b/usr.sbin/ndp/ndp.8 index 942303774ca..f3a59a414a5 100644 --- a/usr.sbin/ndp/ndp.8 +++ b/usr.sbin/ndp/ndp.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ndp.8,v 1.28 2011/04/23 10:14:59 sobrado Exp $ +.\" $OpenBSD: ndp.8,v 1.29 2013/03/11 14:02:37 mpi Exp $ .\" $KAME: ndp.8,v 1.28 2002/07/17 08:46:33 itojun Exp $ .\" .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: April 23 2011 $ +.Dd $Mdocdate: March 11 2013 $ .Dt NDP 8 .Os .\" @@ -45,7 +45,6 @@ .Op Fl A Ar wait .Op Fl d Ar hostname .Op Fl f Ar filename -.Op Fl I Op Ar interface | Ic delete .Op Fl i Ar interface Op Ar flag ... .Op Fl s Ar nodename etheraddr Oo Ic temp Oc Op Ic proxy .Op Ar hostname @@ -123,15 +122,6 @@ 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 -Specifies the default -.Ar interface -to be used when there is no interface specified even though required. -.It Fl I Ic delete -The current default interface will be deleted from the kernel. .It Fl i Ar interface Op Ar flag ... View ND information for the specified interface. If additional arguments are given, diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index 965c6559ee0..5fb2db7cd29 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ndp.c,v 1.45 2009/06/25 15:44:43 claudio Exp $ */ +/* $OpenBSD: ndp.c,v 1.46 2013/03/11 14:02:37 mpi Exp $ */ /* $KAME: ndp.c,v 1.101 2002/07/17 08:46:33 itojun Exp $ */ /* @@ -141,10 +141,6 @@ void pfx_flush(void); void rtrlist(void); void rtr_flush(void); void harmonize_rtr(void); -#ifdef SIOCSDEFIFACE_IN6 /* XXX: check SIOCGDEFIFACE_IN6 as well? */ -static void getdefif(void); -static void setdefif(char *); -#endif static char *sec2str(time_t); static char *ether_str(struct sockaddr_dl *); static void ts_print(const struct timeval *); @@ -168,7 +164,7 @@ main(int argc, char *argv[]) pid = getpid(); thiszone = gmt2local(0); - while ((ch = getopt(argc, argv, "acd:f:Ii:nprstA:HPR")) != -1) + while ((ch = getopt(argc, argv, "acd:f:i:nprstA:HPR")) != -1) switch (ch) { case 'a': case 'c': @@ -178,7 +174,6 @@ main(int argc, char *argv[]) case 'P': case 'R': case 's': - case 'I': if (mode) { usage(); /*NOTREACHED*/ @@ -237,24 +232,6 @@ main(int argc, char *argv[]) } delete(arg); break; - case 'I': -#ifdef SIOCSDEFIFACE_IN6 /* XXX: check SIOCGDEFIFACE_IN6 as well? */ - 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); - } - getdefif(); /* always call it to print the result */ - break; -#else - errx(1, "not supported yet"); - /*NOTREACHED*/ -#endif case 'p': if (argc != 0) { usage(); @@ -829,9 +806,6 @@ usage(void) printf("usage: ndp [-nrt] [-a | -c | -p] [-H | -P | -R] "); printf("[-A wait] [-d hostname]\n"); printf("\t[-f filename] "); -#ifdef SIOCSDEFIFACE_IN6 - printf("[-I [interface | delete]] "); -#endif printf("[-i interface [flag ...]]\n"); printf("\t[-s nodename etheraddr [temp] [proxy]] [hostname]\n"); exit(1); @@ -1447,60 +1421,6 @@ harmonize_rtr(void) close(s); } -#ifdef SIOCSDEFIFACE_IN6 /* XXX: check SIOCGDEFIFACE_IN6 as well? */ -static void -setdefif(char *ifname) -{ - struct in6_ndifreq ndifreq; - unsigned int ifindex; - - if (strcasecmp(ifname, "delete") == 0) - ifindex = 0; - else { - if ((ifindex = if_nametoindex(ifname)) == 0) - err(1, "failed to resolve i/f index for %s", ifname); - } - - if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) - err(1, "socket"); - - strlcpy(ndifreq.ifname, "lo0", sizeof(ndifreq.ifname)); /* dummy */ - ndifreq.ifindex = ifindex; - - if (ioctl(s, SIOCSDEFIFACE_IN6, (caddr_t)&ndifreq) < 0) - err(1, "ioctl(SIOCSDEFIFACE_IN6)"); - - close(s); -} - -static void -getdefif(void) -{ - struct in6_ndifreq ndifreq; - char ifname[IFNAMSIZ+8]; - - if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) - err(1, "socket"); - - memset(&ndifreq, 0, sizeof(ndifreq)); - strlcpy(ndifreq.ifname, "lo0", sizeof(ndifreq.ifname)); /* dummy */ - - if (ioctl(s, SIOCGDEFIFACE_IN6, (caddr_t)&ndifreq) < 0) - err(1, "ioctl(SIOCGDEFIFACE_IN6)"); - - if (ndifreq.ifindex == 0) - printf("No default interface.\n"); - else { - if ((if_indextoname(ndifreq.ifindex, ifname)) == NULL) - err(1, "failed to resolve ifname for index %lu", - ndifreq.ifindex); - printf("ND default interface = %s\n", ifname); - } - - close(s); -} -#endif - static char * sec2str(time_t total) { |