Changeset View
Changeset View
Standalone View
Standalone View
sbin/ifconfig/ifieee80211.c
Show First 20 Lines • Show All 5,794 Lines • ▼ Show 20 Lines | |||||
static struct ieee80211_clone_params params = { | static struct ieee80211_clone_params params = { | ||||
.icp_opmode = IEEE80211_M_STA, /* default to station mode */ | .icp_opmode = IEEE80211_M_STA, /* default to station mode */ | ||||
}; | }; | ||||
static void | static void | ||||
wlan_create(if_ctx *ctx, struct ifreq *ifr) | wlan_create(if_ctx *ctx, struct ifreq *ifr) | ||||
{ | { | ||||
static const uint8_t zerobssid[IEEE80211_ADDR_LEN]; | static const uint8_t zerobssid[IEEE80211_ADDR_LEN]; | ||||
char orig_name[IFNAMSIZ]; | |||||
if (params.icp_parent[0] == '\0') | if (params.icp_parent[0] == '\0') | ||||
errx(1, "must specify a parent device (wlandev) when creating " | errx(1, "must specify a parent device (wlandev) when creating " | ||||
"a wlan device"); | "a wlan device"); | ||||
if (params.icp_opmode == IEEE80211_M_WDS && | if (params.icp_opmode == IEEE80211_M_WDS && | ||||
memcmp(params.icp_bssid, zerobssid, sizeof(zerobssid)) == 0) | memcmp(params.icp_bssid, zerobssid, sizeof(zerobssid)) == 0) | ||||
errx(1, "no bssid specified for WDS (use wlanbssid)"); | errx(1, "no bssid specified for WDS (use wlanbssid)"); | ||||
ifr->ifr_data = (caddr_t) ¶ms; | ifr->ifr_data = (caddr_t) ¶ms; | ||||
ifcreate_ioctl(ctx, ifr); | ifcreate_ioctl(ctx, ifr); | ||||
/* XXX preserve original name for ifclonecreate(). */ | |||||
strlcpy(orig_name, name, sizeof(orig_name)); | |||||
strlcpy(name, ifr->ifr_name, sizeof(name)); | |||||
setdefregdomain(ctx); | setdefregdomain(ctx); | ||||
strlcpy(name, orig_name, sizeof(name)); | |||||
} | } | ||||
static void | static void | ||||
set80211clone_wlandev(if_ctx *ctx __unused, const char *arg, int dummy __unused) | set80211clone_wlandev(if_ctx *ctx __unused, const char *arg, int dummy __unused) | ||||
{ | { | ||||
strlcpy(params.icp_parent, arg, IFNAMSIZ); | strlcpy(params.icp_parent, arg, IFNAMSIZ); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 293 Lines • Show Last 20 Lines |