Finish reverting r286410 for now.

This commit is contained in:
Adrian Chadd 2015-08-10 06:12:53 +00:00
parent 3bce836420
commit d237165a09
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=286565

View File

@ -50,7 +50,7 @@
#include "iwnstats.h"
#include "iwn_ioctl.h"
#define IWN_DEFAULT_IF "wlan0"
#define IWN_DEFAULT_IF "iwn0"
static struct iwnstats *
iwnstats_new(const char *ifname)
@ -290,6 +290,19 @@ main(int argc, char *argv[])
if (ifname)
free(ifname);
ifname = strdup(optarg);
if (strncmp(ifname, "wlan", 4) == 0) {
free(ifname);
len = 0;
asprintf(&sysctlname, "net.wlan.%s.%%parent", ifname + 4);
ret = sysctlbyname(sysctlname, NULL, &len, NULL, 0);
if (ret != 0)
err(1, "sysctl failed");
ifname = calloc(len, 1);
ret = sysctlbyname(sysctlname, ifname, &len, NULL, 0);
if (ret != 0)
err(1, "sysctl failed");
free(sysctlname);
}
break;
default:
case '?':