openbsd-ports/net/kismet/patches/patch-packet_cc

81 lines
3.2 KiB
Plaintext
Raw Normal View History

$OpenBSD: patch-packet_cc,v 1.1 2006/11/01 21:13:20 kili Exp $
# From upstream SVN.
--- packet.cc.orig Sat Apr 1 18:37:07 2006
+++ packet.cc Fri Oct 20 15:38:06 2006
@@ -349,7 +349,8 @@ void GetPacketInfo(kis_packet *packet, p
if (fc->subtype == 8 || fc->subtype == 4 || fc->subtype == 5) {
// This is guaranteed to only give us tags that fit within the packets,
// so we don't have to do more error checking
- if (GetTagOffsets(ret_packinfo->header_offset, packet, &tag_cache_map) < 0) {
+ if (GetTagOffsets(ret_packinfo->header_offset, packet,
+ &tag_cache_map) < 0 && packet->parm.fuzzy_decode == 0) {
// The frame is corrupt, bail
ret_packinfo->corrupt = 1;
return;
@@ -773,6 +774,31 @@ void GetPacketInfo(kis_packet *packet, p
} else if (fc->subtype == 6) {
ret_packinfo->subtype = packet_sub_cf_ack_poll;
+
+ } else if (fc->subtype == 8) {
+ // This is a BIG, LAME hack. We really should process QOS data
+ // properly, but that's for -newcore at this point. For now we'll
+ // just not break, store and ignore the QOS data.
+ ret_packinfo->subtype = packet_sub_data_qos_data;
+
+ } else if (fc->subtype == 9) {
+ ret_packinfo->subtype = packet_sub_data_qos_data_cf_ack;
+
+ } else if (fc->subtype == 10) {
+ ret_packinfo->subtype = packet_sub_data_qos_data_cf_poll;
+
+ } else if (fc->subtype == 11) {
+ ret_packinfo->subtype = packet_sub_data_qos_data_cf_ack_poll;
+
+ } else if (fc->subtype == 12) {
+ ret_packinfo->subtype = packet_sub_data_qos_null;
+
+ } else if (fc->subtype == 14) {
+ ret_packinfo->subtype = packet_sub_data_qos_cf_poll_nod;
+
+ } else if (fc->subtype == 15) {
+ ret_packinfo->subtype = packet_sub_data_qos_cf_ack_poll;
+
} else {
ret_packinfo->corrupt = 1;
ret_packinfo->subtype = packet_sub_unknown;
@@ -830,6 +856,20 @@ void GetPacketInfo(kis_packet *packet, p
break;
}
+ // More QOS hack. We just fudge the header 2 bytes further out
+ // to skip the QOS data.
+ // if (fc->subtype == 8) {
+ // ret_packinfo->header_offset += 2;
+ //}
+ // QOS header info effectively begins just after the end of the
+ // "regular" header, so generate that offset here based on the
+ // header offset we just got and stash the data in ret_packinfo.
+ if (ret_packinfo->subtype == packet_sub_data_qos_data) {
+ ret_packinfo->qos = (uint16_t)packet->data[ret_packinfo->header_offset];
+ // Now do something bad and just fudge the header offset out
+ // a couple bytes here so the rest of the code works.
+ ret_packinfo->header_offset += 2;
+ }
// Check the header bounds
if (packet->len < ret_packinfo->header_offset) {
ret_packinfo->corrupt = 1;
@@ -837,7 +877,9 @@ void GetPacketInfo(kis_packet *packet, p
}
// If we're special data frame types bail now
- if (ret_packinfo->subtype != packet_sub_data) {
+ // Note: QOS data frames also count.
+ if ((ret_packinfo->subtype != packet_sub_data) &&
+ (ret_packinfo->subtype != packet_sub_data_qos_data)) {
ret_packinfo->datasize = 0;
return;
}