summaryrefslogtreecommitdiff
path: root/sbin/ifconfig
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2018-08-12 18:33:56 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2018-08-12 18:33:56 +0000
commit72b9a4ae4f241b8ea3ce73e6761d7d95f668e3f1 (patch)
tree91f46257892fa929fd961ac5db6aa0dd558e789c /sbin/ifconfig
parent2752b82315f06b1acec44bb37f2da5336b6a874c (diff)
Make ifconfig's -joinlist command work as advertised.
ok deraadt phessler
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r--sbin/ifconfig/ifconfig.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 7a89c26dadb..6bc7276ff5e 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.373 2018/08/11 09:18:49 benno Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.374 2018/08/12 18:33:55 stsp Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -1707,23 +1707,16 @@ delifjoin(const char *val, int d)
len = 0;
join.i_flags |= IEEE80211_JOIN_DEL;
- if (val == NULL) {
+ if (d == -1) {
ifr.ifr_data = (caddr_t)&join;
if (ioctl(s, SIOCS80211JOIN, (caddr_t)&ifr) < 0)
warn("SIOCS80211JOIN");
return;
}
- if (d != 0) {
- /* no network id is especially desired */
- memset(&join, 0, sizeof(join));
- len = 0;
- } else {
- len = sizeof(join.i_nwid);
- if (val != NULL &&
- get_string(val, NULL, join.i_nwid, &len) == NULL)
- return;
- }
+ len = sizeof(join.i_nwid);
+ if (get_string(val, NULL, join.i_nwid, &len) == NULL)
+ return;
join.i_len = len;
(void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
ifr.ifr_data = (caddr_t)&join;