diff --git a/sbin/ifconfig/regdomain.c b/sbin/ifconfig/regdomain.c index a06ba552d8cf..414028958e5f 100644 --- a/sbin/ifconfig/regdomain.c +++ b/sbin/ifconfig/regdomain.c @@ -694,8 +694,11 @@ lib80211_country_findbyname(const struct regdata *rdp, const char *name) 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;