Date: Sat, 16 Jan 2010 15:00:36 +0000 (UTC) From: Gavin Atkinson <gavin@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r202446 - stable/8/sbin/ifconfig Message-ID: <201001161500.o0GF0akx028768@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gavin Date: Sat Jan 16 15:00:35 2010 New Revision: 202446 URL: http://svn.freebsd.org/changeset/base/202446 Log: MFC r200587: 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, implicit) Modified: stable/8/sbin/ifconfig/regdomain.c Directory Properties: stable/8/sbin/ifconfig/ (props changed) Modified: stable/8/sbin/ifconfig/regdomain.c ============================================================================== --- stable/8/sbin/ifconfig/regdomain.c Sat Jan 16 14:33:22 2010 (r202445) +++ stable/8/sbin/ifconfig/regdomain.c Sat Jan 16 15:00:35 2010 (r202446) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001161500.o0GF0akx028768>