summaryrefslogtreecommitdiff
path: root/sys/dev/ic/if_wi.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-06-12 04:43:42 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-06-12 04:43:42 +0000
commitc22dc40df755f025740d14e001bb8599cf4a72c5 (patch)
treef717316491f53be92ecdc70aea4edd3fb42cb7b0 /sys/dev/ic/if_wi.c
parent06c7af367f8e424fe98a549fbf7055997d45d9eb (diff)
Previously, SIOCG80211NWID would return the "desired" netname if
the interface was up, even if it was the empty string. This tends to confuse users who have not set the desired net name (ie: associate with any AP). Now we only return the desired net name if it is not empty and the interface is up. Otherwise we return the current net name (ie: what we are associated with).
Diffstat (limited to 'sys/dev/ic/if_wi.c')
-rw-r--r--sys/dev/ic/if_wi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c
index 4b97d4bd757..c18f715fa05 100644
--- a/sys/dev/ic/if_wi.c
+++ b/sys/dev/ic/if_wi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi.c,v 1.64 2002/06/09 03:14:18 todd Exp $ */
+/* $OpenBSD: if_wi.c,v 1.65 2002/06/12 04:43:41 millert Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -124,7 +124,7 @@ u_int32_t widebug = WIDEBUG;
#if !defined(lint) && !defined(__OpenBSD__)
static const char rcsid[] =
- "$OpenBSD: if_wi.c,v 1.64 2002/06/09 03:14:18 todd Exp $";
+ "$OpenBSD: if_wi.c,v 1.65 2002/06/12 04:43:41 millert Exp $";
#endif /* lint */
#ifdef foo
@@ -1634,7 +1634,7 @@ wi_ioctl(ifp, command, data)
error = wi_set_debug(sc, &wreq);
break;
case SIOCG80211NWID:
- if (ifp->if_flags & IFF_UP) {
+ if ((ifp->if_flags & IFF_UP) && sc->wi_net_name.i_len > 0) {
/* Return the desired ID */
error = copyout(&sc->wi_net_name, ifr->ifr_data,
sizeof(sc->wi_net_name));