summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2002-06-12 04:43:41 +0000
committermillert <millert@openbsd.org>2002-06-12 04:43:41 +0000
commiteee287cda7003ed4f03ef2d00d2fca7b621f1089 (patch)
tree700df9bf23ae3f0bf12ec7856a9c9820d31183fc
parentuse ELF_TOOLCHAIN instead of listing all archs. (diff)
downloadwireguard-openbsd-eee287cda7003ed4f03ef2d00d2fca7b621f1089.tar.xz
wireguard-openbsd-eee287cda7003ed4f03ef2d00d2fca7b621f1089.zip
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).
-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));