svn commit: r187834 - head/sys/net80211

Sam Leffler sam at FreeBSD.org
Wed Jan 28 10:37:47 PST 2009


Author: sam
Date: Wed Jan 28 18:37:46 2009
New Revision: 187834
URL: http://svn.freebsd.org/changeset/base/187834

Log:
  change null_getradiocaps to return the actual count of channels instead
  of the true number; otherwise the caller may use the count to do things
  with the data it should not (e.g. sort the channel table)

Modified:
  head/sys/net80211/ieee80211_regdomain.c

Modified: head/sys/net80211/ieee80211_regdomain.c
==============================================================================
--- head/sys/net80211/ieee80211_regdomain.c	Wed Jan 28 18:14:24 2009	(r187833)
+++ head/sys/net80211/ieee80211_regdomain.c	Wed Jan 28 18:37:46 2009	(r187834)
@@ -48,10 +48,10 @@ null_getradiocaps(struct ieee80211com *i
 	int *n, struct ieee80211_channel *c)
 {
 	/* just feed back the current channel list */
-	*n = ic->ic_nchans;		/* XXX return count copied? */
 	if (maxchan > ic->ic_nchans)
 		maxchan = ic->ic_nchans;
 	memcpy(c, ic->ic_channels, maxchan*sizeof(struct ieee80211_channel));
+	*n = maxchan;
 }
 
 static int


More information about the svn-src-head mailing list