From 8d271549cdc06d7c1cbc8496261be118e90f5e24 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 11 Feb 2013 16:02:16 +0100 Subject: wifi: filter SNAP ethernet orgcode only --- sys/src/9/pc/wifi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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){ -- cgit v1.2.3