Index: sbin/ifconfig/ifieee80211.c =================================================================== --- sbin/ifconfig/ifieee80211.c (revision 301413) +++ sbin/ifconfig/ifieee80211.c (working copy) @@ -5190,6 +5190,7 @@ wlan_create(int s, struct ifreq *ifr) { static const uint8_t zerobssid[IEEE80211_ADDR_LEN]; + char orig_name[IFNAMSIZ]; if (params.icp_parent[0] == '\0') errx(1, "must specify a parent device (wlandev) when creating " @@ -5201,7 +5202,13 @@ if (ioctl(s, SIOCIFCREATE2, ifr) < 0) err(1, "SIOCIFCREATE2"); + /* XXX preserve original name for ifclonecreate(). */ + strlcpy(orig_name, name, sizeof(orig_name)); + strlcpy(name, ifr->ifr_name, sizeof(name)); + setdefregdomain(s); + + strlcpy(name, orig_name, sizeof(name)); } static