Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jun 2016 17:21:15 +0000 (UTC)
From:      Andriy Voskoboinyk <avos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r301651 - head/sbin/ifconfig
Message-ID:  <201606081721.u58HLFsP024925@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avos
Date: Wed Jun  8 17:21:15 2016
New Revision: 301651
URL: https://svnweb.freebsd.org/changeset/base/301651

Log:
  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>

Modified:
  head/sbin/ifconfig/ifieee80211.c

Modified: head/sbin/ifconfig/ifieee80211.c
==============================================================================
--- head/sbin/ifconfig/ifieee80211.c	Wed Jun  8 17:17:03 2016	(r301650)
+++ head/sbin/ifconfig/ifieee80211.c	Wed Jun  8 17:21:15 2016	(r301651)
@@ -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



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