]> The Tcpdump Group git mirrors - libpcap/commitdiff
Mark radio link headers as variable.
authorJesse Gross <[email protected]>
Thu, 12 Feb 2015 19:14:26 +0000 (11:14 -0800)
committerFrancois-Xavier Le Bail <[email protected]>
Tue, 17 Feb 2015 14:40:00 +0000 (15:40 +0100)
Previously, not all variable length offsets had an is_variable flag
- this knowledge was essentially encoded in the generating logic.
Now that the offset code has been generalized, the flag has been
included for these cases as well and it needs to be set appropriately.
The radio code was missing it for the link headers so this adds it.

gencode.c

index 45eb42d54dda94a651ea3ca7724cf99304aa21f1..6f03326c73aee59c0632986f780299dc36c312c7 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -1107,10 +1107,14 @@ init_linktype(p)
                off_nl_nosnap = 3;      /* 802.2 */
                break;
 
-       case DLT_IEEE802_11:
        case DLT_PRISM_HEADER:
        case DLT_IEEE802_11_RADIO_AVS:
        case DLT_IEEE802_11_RADIO:
+               off_linkhdr.is_variable = 1;
+               /* Fall through, 802.11 doesn't have a variable link
+                * prefix but is otherwise the same. */
+
+       case DLT_IEEE802_11:
                /*
                 * 802.11 doesn't really have a link-level type field.
                 * We set "off_linktype" to the offset of the LLC header.
@@ -1148,6 +1152,7 @@ init_linktype(p)
                off_linktype = 24;
                off_linkpl.constant_part = 0;   /* link-layer header is variable-length */
                off_linkpl.is_variable = 1;
+               off_linkhdr.is_variable = 1;
                off_nl = 8;             /* 802.2+SNAP */
                off_nl_nosnap = 3;      /* 802.2 */
                break;