Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Dec 2009 20:50:03 GMT
From:      dfilter@FreeBSD.ORG (dfilter service)
To:        freebsd-net@FreeBSD.org
Subject:   Re: bin/140571: commit references a PR
Message-ID:  <200912152050.nBFKo3xt065317@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/140571; it has been noted by GNATS.

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/140571: commit references a PR
Date: Tue, 15 Dec 2009 20:44:26 +0000 (UTC)

 Author: gavin
 Date: Tue Dec 15 20:44:12 2009
 New Revision: 200587
 URL: http://svn.freebsd.org/changeset/base/200587
 
 Log:
   ifconfig(8) is documented to take a ISO 3166-1 country code to set the
   regulatory domain with the "country" parameter, but will also take a full
   country name.  The man page warns that only the ISO code is unambiguous.
   In reality, however, the first match on either would be accepted, leading
   to "DE" being interpreted as the "DEBUG" country rather than Germany, and
   "MO" selecting Morocco rather than the correct country, Macau.
   
   Fix this by always checking for an ISO CC match first, and only search on
   the full country name if that fails.
   
   PR:		bin/140571
   Tested by:	Dirk Meyer dirk.meyer dinoex.sub.org
   Reviewed by:	sam
   Approved by:	ed (mentor)
   MFC after:	1 month
 
 Modified:
   head/sbin/ifconfig/regdomain.c
 
 Modified: head/sbin/ifconfig/regdomain.c
 ==============================================================================
 --- head/sbin/ifconfig/regdomain.c	Tue Dec 15 20:20:05 2009	(r200586)
 +++ head/sbin/ifconfig/regdomain.c	Tue Dec 15 20:44:12 2009	(r200587)
 @@ -694,8 +694,11 @@ lib80211_country_findbyname(const struct
  
  	len = strlen(name);
  	LIST_FOREACH(cp, &rdp->countries, next) {
 -		if (strcasecmp(cp->isoname, name) == 0 ||
 -		    strncasecmp(cp->name, name, len) == 0)
 +		if (strcasecmp(cp->isoname, name) == 0)
 +			return cp;
 +	}
 +	LIST_FOREACH(cp, &rdp->countries, next) {
 +		if (strncasecmp(cp->name, name, len) == 0)
  			return cp;
  	}
  	return NULL;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912152050.nBFKo3xt065317>