Skip to content

Commit e10c312

Browse files
committed
ntohs mdid fix
1 parent 22efc69 commit e10c312

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

hcxpcapngtool.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3415,6 +3415,7 @@ return true;
34153415
static bool gettags(int infolen, uint8_t *infoptr, tags_t *zeiger)
34163416
{
34173417
static ietag_t *tagptr;
3418+
static mdid_t *mdidptr;
34183419
static uint8_t tagok;
34193420
static bool ef;
34203421

@@ -3507,7 +3508,8 @@ while(0 < infolen)
35073508
if(tagptr->len == 3)
35083509
{
35093510
zeiger->mdidlen = tagptr->len;
3510-
zeiger->mdid = (tagptr->data[0] << 8) | tagptr->data[1];
3511+
mdidptr = (mdid_t*)tagptr->data;
3512+
zeiger->mdid = ntohs(mdidptr->mdid);
35113513
}
35123514
else
35133515
{

include/ieee80211.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,13 @@ struct wpsie_tag
452452
typedef struct wpsie_tag wpsie_t;
453453
#define WPSIE_SIZE offsetof(wpsie_t, data)
454454
/*===========================================================================*/
455+
struct mdid_tag
456+
{
457+
uint16_t mdid;
458+
} __attribute__ ((packed));
459+
typedef struct mdid_tag mdid_t;
460+
#define MDID_SIZE sizeof(mdid_t)
461+
/*===========================================================================*/
455462
struct fbsst_tag
456463
{
457464
uint16_t miccontrol;

0 commit comments

Comments
 (0)