From b4de50120bf25816d3c78f45436aba48ae110da2 Mon Sep 17 00:00:00 2001 From: deraadt Date: Sun, 25 Oct 2015 11:44:30 +0000 Subject: [PATCH] backout; many issues remain... --- usr.sbin/ndp/ndp.c | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index 2d01ef48bdf..288d6f10fc1 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ndp.c,v 1.65 2015/10/25 08:07:31 deraadt Exp $ */ +/* $OpenBSD: ndp.c,v 1.66 2015/10/25 11:44:30 deraadt Exp $ */ /* $KAME: ndp.c,v 1.101 2002/07/17 08:46:33 itojun Exp $ */ /* @@ -332,18 +332,12 @@ file(char *name) void getsocket(void) { - if (s >= 0) - return; - s = socket(PF_ROUTE, SOCK_RAW, 0); - if (s < 0) - err(1, "socket"); - - if (nflag) { - if (pledge("stdio", NULL) == -1) - err(1, "pledge"); - } else { - if (pledge("stdio dns", NULL) == -1) - err(1, "pledge"); + if (s < 0) { + s = socket(PF_ROUTE, SOCK_RAW, 0); + if (s < 0) { + err(1, "socket"); + /* NOTREACHED */ + } } } @@ -606,14 +600,6 @@ again:; break; } - if (nflag) { - if (pledge("stdio route", NULL) == -1) - err(1, "pledge"); - } else { - if (pledge("stdio route dns", NULL) == -1) - err(1, "pledge"); - } - for (next = buf; next && next < lim; next += rtm->rtm_msglen) { int isrouter = 0, prbs = 0; @@ -808,8 +794,8 @@ usage(void) { printf("usage: ndp [-nrt] [-a | -c | -p] [-H | -P | -R] "); printf("[-A wait] [-d hostname]\n"); - printf(" [-f filename] [-i interface [flag ...]]\n"); - printf(" [-s nodename etheraddr [temp] [proxy]] "); + printf("\t[-f filename] [-i interface [flag ...]]\n"); + printf("\t[-s nodename etheraddr [temp] [proxy]] "); printf("[-V rdomain] [hostname]\n"); exit(1); } -- 2.20.1