#define E_SSID 0
#define E_RATES 1
-#define E_FH 2
+#define E_FH 2
#define E_DS 3
-#define E_CF 4
-#define E_TIM 5
+#define E_CF 4
+#define E_TIM 5
#define E_IBSS 6
/* reserved 7 */
/* reserved 8 */
#define PRINT_SSID(p) \
if (p.ssid_present) { \
ND_PRINT(" ("); \
- nd_print(ndo, p.ssid.ssid, NULL); \
+ fn_print_str(ndo, p.ssid.ssid); \
ND_PRINT(")"); \
}
"Reserved", /* 8 */
"Reserved", /* 9 */
"Cannot Support all requested capabilities in the Capability "
- "Information field", /* 10 */
+ "Information field", /* 10 */
"Reassociation denied due to inability to confirm that association "
"exists", /* 11 */
"Association denied due to reason outside the scope of the "
"sequence number out of expected sequence", /* 14 */
"Authentication rejected because of challenge failure", /* 15 */
"Authentication rejected due to timeout waiting for next frame in "
- "sequence", /* 16 */
+ "sequence", /* 16 */
"Association denied because AP is unable to handle additional"
- "associated stations", /* 17 */
+ "associated stations", /* 17 */
"Association denied due to requesting station not supporting all of "
"the data rates in BSSBasicRateSet parameter", /* 18 */
"Association denied due to requesting station not supporting "
}
}
-#ifndef roundup2
-#define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */
-#endif
-
-
static u_int
ieee802_11_print(netdissect_options *ndo,
const u_char *p, u_int length, u_int orig_caplen, int pad,
hdrlen = roundup2(hdrlen, 4);
if (ndo->ndo_Hflag && FC_TYPE(fc) == T_DATA &&
DATA_FRAME_IS_QOS(FC_SUBTYPE(fc))) {
+ if(!ND_TTEST_1(p + hdrlen)) {
+ nd_print_trunc(ndo);
+ return hdrlen;
+ }
meshdrlen = extract_mesh_header_length(p+hdrlen);
hdrlen += meshdrlen;
} else
hdr = (const struct ieee80211_radiotap_header *)p;
len = EXTRACT_LE_U_2(hdr->it_len);
+ if (len < sizeof(*hdr)) {
+ /*
+ * The length is the length of the entire header, so
+ * it must be as large as the fixed-length part of
+ * the header.
+ */
+ nd_print_trunc(ndo);
+ return caplen;
+ }
/*
* If we don't have the entire radiotap header, just give up.