pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/ethereal re-apply the fix for alignment of radiota...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a079e1214cb1
branches:  trunk
changeset: 511900:a079e1214cb1
user:      drochner <drochner%pkgsrc.org@localhost>
date:      Tue Apr 25 15:40:56 2006 +0000

description:
re-apply the fix for alignment of radiotap data fields, and fix
two newly introduced problems:
-botch in picking up IEEE80211_RADIOTAP_FLAGS
-wrong offset passed to inner dissector

diffstat:

 net/ethereal/distinfo         |    3 +-
 net/ethereal/patches/patch-aa |  118 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 120 insertions(+), 1 deletions(-)

diffs (133 lines):

diff -r f9973d7e13ea -r a079e1214cb1 net/ethereal/distinfo
--- a/net/ethereal/distinfo     Tue Apr 25 14:17:43 2006 +0000
+++ b/net/ethereal/distinfo     Tue Apr 25 15:40:56 2006 +0000
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.51 2006/04/25 12:29:25 salo Exp $
+$NetBSD: distinfo,v 1.52 2006/04/25 15:40:56 drochner Exp $
 
 SHA1 (ethereal-0.99.0.tar.bz2) = 466299ac49f21904ed91b93e81667f226637e868
 RMD160 (ethereal-0.99.0.tar.bz2) = f86e21ae60d53e1ed60b61e58c2941ecfd4d8696
 Size (ethereal-0.99.0.tar.bz2) = 8884587 bytes
+SHA1 (patch-aa) = fab9658f576d15fbf458f173411f650787adf7bf
diff -r f9973d7e13ea -r a079e1214cb1 net/ethereal/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/ethereal/patches/patch-aa     Tue Apr 25 15:40:56 2006 +0000
@@ -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



Home | Main Index | Thread Index | Old Index