wlandebug(8): add a sanity check.

This commit is contained in:
Andriy Voskoboinyk 2017-10-16 07:15:50 +00:00
parent 238c9eb65a
commit 3ce85fa36b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=324658

View File

@ -172,6 +172,9 @@ get_orig_iface_name(char *oid, size_t oid_size, char *name)
if (ifconfig_get_orig_name(h, name, &orig_name) < 0)
errc(1, ifconfig_err_errno(h), "cannot get interface name");
if (strlen(orig_name) < strlen("wlan") + 1)
errx(1, "expecting a wlan interface name");
ifconfig_close(h);
setoid(oid, oid_size, orig_name);
free(orig_name);