From owner-svn-src-all@freebsd.org Wed Jun 8 17:21:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85653B6FE7E; Wed, 8 Jun 2016 17:21:16 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E5661861; Wed, 8 Jun 2016 17:21:16 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HLFtF024926; Wed, 8 Jun 2016 17:21:15 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HLFsP024925; Wed, 8 Jun 2016 17:21:15 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606081721.u58HLFsP024925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 8 Jun 2016 17:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301651 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:21:16 -0000 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 , adrian Tested by: Yoshihiro Ota 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