Subject: Re: issues with 802.11 radiotap
To: David Young <dyoung@pobox.com>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: tech-net
Date: 07/13/2005 21:04:03
This is a multipart MIME message.

--==_Exmh_2056187086250
Content-Type: text/plain; charset=us-ascii


dyoung@pobox.com said:
> I will update the manual page to use suitably strong language about
> natural alignment.

It looks pretty clear now...

> I will also send a PR to ethereal, because they
> really *do* have it wrong.

I'll append the patch which I'm using atm and which I've
added to the pkgsrc version.
(fixes just the alignment problems)
There are more problems, the FCS thing as said, and some
fields are completely misinterpreted.

best regards
Matthias



--==_Exmh_2056187086250
Content-Type: text/plain ; name="patch-aa"; charset=us-ascii
Content-Description: patch-aa
Content-Disposition: attachment; filename="patch-aa"

$NetBSD: patch-aa,v 1.15 2005/07/13 10:01:53 drochner Exp $

--- epan/dissectors/packet-radiotap.c.orig	2005-07-12 17:36:14.000000000 +0200
+++ epan/dissectors/packet-radiotap.c
@@ -397,6 +397,7 @@ dissect_radiotap(tvbuff_t *tvb, packet_i
 	    offset++;
 	    break;
 	case IEEE80211_RADIOTAP_CHANNEL:
+	    offset = (offset + 1) & ~1;
 	    if (tree) {
 		freq = tvb_get_letohs(tvb, offset);
 		flags = tvb_get_letohs(tvb, offset+2);
@@ -412,12 +413,14 @@ dissect_radiotap(tvbuff_t *tvb, packet_i
 	case IEEE80211_RADIOTAP_LOCK_QUALITY:
 	case IEEE80211_RADIOTAP_TX_ATTENUATION:
 	case IEEE80211_RADIOTAP_DB_TX_ATTENUATION:
+	    offset = (offset + 1) & ~1;
 #if 0
 	    tvb_get_letohs(tvb, offset);
 #endif
 	    offset+=2;
 	    break;
 	case IEEE80211_RADIOTAP_TSFT:
+	    offset = (offset + 7) & ~7;
 	    if (tree) {
 		proto_tree_add_item(radiotap_tree, hf_radiotap_mactime,
 				    tvb, offset, 8, FALSE);

--==_Exmh_2056187086250--