summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2008-08-14 03:49:14 +0000
committerthompsa <thompsa@FreeBSD.org>2008-08-14 03:49:14 +0000
commit77e8d2fea0a3f6b240cd6be67265a6980407d6e9 (patch)
tree1050d50559d699b5544f03587ee86f6118d851b3 /sbin/ifconfig
parent088a5c65f84d05482670e8f1263d2c31b8367eeb (diff)
downloadFreeBSD-src-77e8d2fea0a3f6b240cd6be67265a6980407d6e9.zip
FreeBSD-src-77e8d2fea0a3f6b240cd6be67265a6980407d6e9.tar.gz
Fix channel parsing which was broken in r179958, the channel number may be
suffixed with :flag and /width.
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r--sbin/ifconfig/ifieee80211.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c
index cf306bb..2250a67 100644
--- a/sbin/ifconfig/ifieee80211.c
+++ b/sbin/ifconfig/ifieee80211.c
@@ -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);
OpenPOWER on IntegriCloud