summaryrefslogtreecommitdiff
path: root/sys/src/9/pc/etherwpi.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-10-09 05:10:47 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2015-10-09 05:10:47 +0200
commit4040ea7a5eda976098131794e8df3b162cafa8f4 (patch)
tree99416d4a3ba5ed78a5a402a6bde4599448a2051f /sys/src/9/pc/etherwpi.c
parentb29e414bc64537c9af8d5ebd8f73775bceaa5fa2 (diff)
wifi: quote value of parsed ether options
introduce wificfg() function to convert ether->opt[] strings to wifictl messages, which needs quoting for the value. so etherX=type=iwl essid='something with spaces' works.
Diffstat (limited to 'sys/src/9/pc/etherwpi.c')
-rw-r--r--sys/src/9/pc/etherwpi.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/sys/src/9/pc/etherwpi.c b/sys/src/9/pc/etherwpi.c
index 00e1e4847..4dbc65e6d 100644
--- a/sys/src/9/pc/etherwpi.c
+++ b/sys/src/9/pc/etherwpi.c
@@ -1491,27 +1491,12 @@ wpiifstat(Ether *edev, void *buf, long n, ulong off)
static void
setoptions(Ether *edev)
{
- char buf[64], *p;
Ctlr *ctlr;
int i;
ctlr = edev->ctlr;
- for(i = 0; i < edev->nopt; i++){
- snprint(buf, sizeof(buf), "%s", edev->opt[i]);
- p = strchr(buf, '=');
- if(p != nil)
- *p = 0;
- if(strcmp(buf, "debug") == 0
- || strcmp(buf, "essid") == 0
- || strcmp(buf, "bssid") == 0){
- if(p != nil)
- *p = ' ';
- if(!waserror()){
- wifictl(ctlr->wifi, buf, strlen(buf));
- poperror();
- }
- }
- }
+ for(i = 0; i < edev->nopt; i++)
+ wificfg(ctlr->wifi, edev->opt[i]);
}
static void