summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2005-11-28 00:17:14 +0000
committerjsg <jsg@openbsd.org>2005-11-28 00:17:14 +0000
commit2cfb2b6f88b2a468a6ea3ac3236ef56777b2d85a (patch)
tree292ba136082f52abc1ac504bbc1a7435d73b29b3
parentansi/deregister. (diff)
downloadwireguard-openbsd-2cfb2b6f88b2a468a6ea3ac3236ef56777b2d85a.tar.xz
wireguard-openbsd-2cfb2b6f88b2a468a6ea3ac3236ef56777b2d85a.zip
Correctly report channel. PR 4728.
ok fgsch@
-rw-r--r--sys/dev/ic/if_wi.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c
index 0bd90ea7060..3a367f66706 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.124 2005/11/01 03:10:21 jsg Exp $ */
+/* $OpenBSD: if_wi.c,v 1.125 2005/11/28 00:17:14 jsg Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -128,7 +128,7 @@ u_int32_t widebug = WIDEBUG;
#if !defined(lint) && !defined(__OpenBSD__)
static const char rcsid[] =
- "$OpenBSD: if_wi.c,v 1.124 2005/11/01 03:10:21 jsg Exp $";
+ "$OpenBSD: if_wi.c,v 1.125 2005/11/28 00:17:14 jsg Exp $";
#endif /* lint */
#ifdef foo
@@ -1853,8 +1853,14 @@ wi_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
wi_init(sc);
break;
case SIOCG80211CHANNEL:
+ wreq.wi_type = WI_RID_CURRENT_CHAN;
+ wreq.wi_len = WI_MAX_DATALEN;
+ if (wi_read_record(sc, (struct wi_ltv_gen *)&wreq)) {
+ error = EINVAL;
+ break;
+ }
((struct ieee80211chanreq *)data)->i_channel =
- sc->wi_channel;
+ letoh16(wreq.wi_val[0]);
break;
case SIOCHOSTAP_ADD:
case SIOCHOSTAP_DEL: