diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-02-11 16:02:16 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-02-11 16:02:16 +0100 |
commit | 8d271549cdc06d7c1cbc8496261be118e90f5e24 (patch) | |
tree | 6e4e90aad383ed5fb2cc675bb835efc183dee450 /sys/src/9/pc/wifi.c | |
parent | 1f6a402c46d5f95c656b14e4fa9a5de933576f01 (diff) |
wifi: filter SNAP ethernet orgcode only
Diffstat (limited to 'sys/src/9/pc/wifi.c')
-rw-r--r-- | sys/src/9/pc/wifi.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/src/9/pc/wifi.c b/sys/src/9/pc/wifi.c index cc880ac49..0aef25d68 100644 --- a/sys/src/9/pc/wifi.c +++ b/sys/src/9/pc/wifi.c @@ -63,9 +63,13 @@ wifiiq(Wifi *wifi, Block *b) default: goto drop; } - if(BLEN(b) < SNAPHDRSIZE || b->rp[0] != 0xAA || b->rp[1] != 0xAA || b->rp[2] != 0x03) + if(BLEN(b) < SNAPHDRSIZE) break; memmove(&s, b->rp, SNAPHDRSIZE); + if(s.dsap != 0xAA || s.ssap != 0xAA || s.control != 3) + break; + if(s.orgcode[0] != 0 || s.orgcode[1] != 0 || s.orgcode[2] != 0) + break; b->rp += SNAPHDRSIZE-ETHERHDRSIZE; e = (Etherpkt*)b->rp; switch(w.fc[1] & 0x03){ |