summaryrefslogtreecommitdiff
path: root/net/ethereal/patches/patch-aa
diff options
context:
space:
mode:
Diffstat (limited to 'net/ethereal/patches/patch-aa')
-rw-r--r--net/ethereal/patches/patch-aa118
1 files changed, 118 insertions, 0 deletions
diff --git a/net/ethereal/patches/patch-aa b/net/ethereal/patches/patch-aa
new file mode 100644
index 00000000000..daf1977ef29
--- /dev/null
+++ b/net/ethereal/patches/patch-aa
@@ -0,0 +1,118 @@
+$NetBSD: patch-aa,v 1.17 2006/04/25 15:40:56 drochner Exp $
+
+--- epan/dissectors/packet-radiotap.c.orig 2006-04-17 16:46:52.000000000 +0200
++++ epan/dissectors/packet-radiotap.c
+@@ -388,6 +388,7 @@ dissect_radiotap(tvbuff_t *tvb, packet_i
+ guint8 db, rflags;
+ guint32 present, next_present;
+ int bit;
++ gint8 align;
+
+ if(check_col(pinfo->cinfo, COL_PROTOCOL))
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "WLAN");
+@@ -465,7 +466,6 @@ dissect_radiotap(tvbuff_t *tvb, packet_i
+ case IEEE80211_RADIOTAP_RATE:
+ if (length < 1)
+ break;
+- rflags = tvb_get_guint8(tvb, offset);
+ rate = tvb_get_guint8(tvb, offset) & 0x7f;
+ if (check_col(pinfo->cinfo, COL_TX_RATE)) {
+ col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%d.%d",
+@@ -482,7 +482,6 @@ dissect_radiotap(tvbuff_t *tvb, packet_i
+ case IEEE80211_RADIOTAP_DBM_ANTSIGNAL:
+ if (length < 1)
+ break;
+- rflags = tvb_get_guint8(tvb, offset);
+ dbm = (gint8) tvb_get_guint8(tvb, offset);
+ if (check_col(pinfo->cinfo, COL_RSSI)) {
+ col_add_fstr(pinfo->cinfo, COL_RSSI, "%d dBm", dbm);
+@@ -499,7 +498,6 @@ dissect_radiotap(tvbuff_t *tvb, packet_i
+ case IEEE80211_RADIOTAP_DB_ANTSIGNAL:
+ if (length < 1)
+ break;
+- rflags = tvb_get_guint8(tvb, offset);
+ db = tvb_get_guint8(tvb, offset);
+ if (check_col(pinfo->cinfo, COL_RSSI)) {
+ col_add_fstr(pinfo->cinfo, COL_RSSI, "%u dB", db);
+@@ -516,7 +514,6 @@ dissect_radiotap(tvbuff_t *tvb, packet_i
+ case IEEE80211_RADIOTAP_DBM_ANTNOISE:
+ if (length < 1)
+ break;
+- rflags = tvb_get_guint8(tvb, offset);
+ dbm = (gint8) tvb_get_guint8(tvb, offset);
+ if (tree) {
+ proto_tree_add_int_format(radiotap_tree,
+@@ -530,7 +527,6 @@ dissect_radiotap(tvbuff_t *tvb, packet_i
+ case IEEE80211_RADIOTAP_DB_ANTNOISE:
+ if (length < 1)
+ break;
+- rflags = tvb_get_guint8(tvb, offset);
+ db = tvb_get_guint8(tvb, offset);
+ if (tree) {
+ proto_tree_add_uint_format(radiotap_tree,
+@@ -544,7 +540,6 @@ dissect_radiotap(tvbuff_t *tvb, packet_i
+ case IEEE80211_RADIOTAP_ANTENNA:
+ if (length < 1)
+ break;
+- rflags = tvb_get_guint8(tvb, offset);
+ if (tree) {
+ proto_tree_add_uint(radiotap_tree, hf_radiotap_antenna,
+ tvb, offset, 1, tvb_get_guint8(tvb, offset));
+@@ -555,7 +550,6 @@ dissect_radiotap(tvbuff_t *tvb, packet_i
+ case IEEE80211_RADIOTAP_DBM_TX_POWER:
+ if (length < 1)
+ break;
+- rflags = tvb_get_guint8(tvb, offset);
+ if (tree) {
+ proto_tree_add_int(radiotap_tree, hf_radiotap_txpower,
+ tvb, offset, 1, tvb_get_guint8(tvb, offset));
+@@ -564,9 +558,11 @@ dissect_radiotap(tvbuff_t *tvb, packet_i
+ length--;
+ break;
+ case IEEE80211_RADIOTAP_CHANNEL:
++ align = ((offset + 1) & ~1) - offset;
++ offset += align;
++ length -= align;
+ if (length < 4)
+ break;
+- rflags = tvb_get_guint8(tvb, offset);
+ if (tree) {
+ freq = tvb_get_letohs(tvb, offset);
+ flags = tvb_get_letohs(tvb, offset+2);
+@@ -583,9 +579,11 @@ dissect_radiotap(tvbuff_t *tvb, packet_i
+ case IEEE80211_RADIOTAP_LOCK_QUALITY:
+ case IEEE80211_RADIOTAP_TX_ATTENUATION:
+ case IEEE80211_RADIOTAP_DB_TX_ATTENUATION:
++ align = ((offset + 1) & ~1) - offset;
++ offset += align;
++ length -= align;
+ if (length < 2)
+ break;
+- rflags = tvb_get_guint8(tvb, offset);
+ #if 0
+ tvb_get_letohs(tvb, offset);
+ #endif
+@@ -593,9 +591,13 @@ dissect_radiotap(tvbuff_t *tvb, packet_i
+ length-=2;
+ break;
+ case IEEE80211_RADIOTAP_TSFT:
++#if 0 /* can't happen because always first */
++ align = ((offset + 7) & ~7) - offset;
++ offset += align;
++ length -= align;
++#endif
+ if (length < 8)
+ break;
+- rflags = tvb_get_guint8(tvb, offset);
+ if (tree) {
+ proto_tree_add_uint64(radiotap_tree, hf_radiotap_mactime,
+ tvb, offset, 8, tvb_get_letoh64(tvb, offset));
+@@ -618,7 +620,7 @@ dissect_radiotap(tvbuff_t *tvb, packet_i
+ /* dissect the 802.11 header next */
+ call_dissector((rflags & IEEE80211_RADIOTAP_F_DATAPAD) ?
+ ieee80211_datapad_handle : ieee80211_handle,
+- tvb_new_subset(tvb, length, -1, -1), pinfo, tree);
++ tvb_new_subset(tvb, offset + length, -1, -1), pinfo, tree);
+ }
+
+ void