summaryrefslogtreecommitdiff
path: root/sbin/ifconfig
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-08-18 08:21:09 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-08-18 08:21:09 +0000
commit8f115e7f0c29b471c155f91fd7ce156695ad734e (patch)
treea86afbba19739d94a0e99152d3030fc978b8ba48 /sbin/ifconfig
parentd42fd20be6702007ccebcd257701e74e6b980d20 (diff)
make non-root -M use not cut ifconfig output; ok jsg
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r--sbin/ifconfig/ifconfig.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index d1c95ee44c6..d44ffa3ebfb 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.172 2006/08/02 07:38:33 grunk Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.173 2006/08/18 08:21:08 deraadt Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -1672,7 +1672,7 @@ ieee80211_listnodes(void)
struct ieee80211_nodereq_all na;
struct ieee80211_nodereq nr[512];
struct ifreq ifr;
- int i, ret, down = 0;
+ int i, down = 0;
if ((flags & IFF_UP) == 0) {
down = 1;
@@ -1681,10 +1681,12 @@ ieee80211_listnodes(void)
bzero(&ifr, sizeof(ifr));
strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
- ret = 1;
- if (ioctl(s, SIOCS80211SCAN, (caddr_t)&ifr) != 0)
+ if (ioctl(s, SIOCS80211SCAN, (caddr_t)&ifr) != 0) {
+ if (errno == EPERM)
+ printf("\t\tno permission to scan\n");
goto done;
+ }
bzero(&na, sizeof(na));
bzero(&nr, sizeof(nr));
@@ -1706,14 +1708,9 @@ ieee80211_listnodes(void)
putchar('\n');
}
- ret = 0;
-
done:
if (down)
setifflags("restore", -IFF_UP);
-
- if (ret != 0)
- exit(1);
}
void