mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 19:52:44 +00:00
Fix channel parsing which was broken in r179958, the channel number may be
suffixed with :flag and /width.
This commit is contained in:
parent
7cdd50e189
commit
5c43e5f42d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=181722
@ -670,8 +670,10 @@ set80211channel(const char *val, int d, int s, const struct afswtch *rafp)
|
||||
|
||||
getchaninfo(s);
|
||||
v = strtol(val, &ep, 10);
|
||||
if (val[0] == '\0' || ep[0] != '\0' || errno == ERANGE)
|
||||
errx(1, "invalid channel number");
|
||||
if (val[0] == '\0' || val == ep || errno == ERANGE ||
|
||||
/* channel may be suffixed with nothing, :flag, or /width */
|
||||
(ep[0] != '\0' && ep[0] != ':' && ep[0] != '/'))
|
||||
errx(1, "invalid channel specification");
|
||||
flags = getchannelflags(val, v);
|
||||
if (v > 255) { /* treat as frequency */
|
||||
mapfreq(&chan, v, flags);
|
||||
|
Loading…
Reference in New Issue
Block a user