mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 08:09:08 +00:00
ifconfig: fix wlan creation when unit number is not provided
(was broken after r300738). Reported by: Yoshihiro Ota <ota@j.email.ne.jp>, adrian Tested by: Yoshihiro Ota <ota@j.email.ne.jp>
This commit is contained in:
parent
3648197a1b
commit
7951c6aa9b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=301651
@ -5190,6 +5190,7 @@ static void
|
||||
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 @@ wlan_create(int s, struct ifreq *ifr)
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user