Skip to content

Commit

Permalink
increase driver link buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Feb 4, 2024
1 parent f2d12ac commit 1f018b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 5 additions & 5 deletions hcxdumptool.c
Original file line number Diff line number Diff line change
Expand Up @@ -3289,8 +3289,8 @@ static struct genlmsghdr *glh;
static struct nlattr *nla;
static struct nlmsgerr *nle;
static char *drivername = NULL;
static char driverfmt[128] = { 0 };
static char driverlink[128] = { 0 };
static char driverfmt[DRIVER_FORMAT] = { 0 };
static char driverlink[DRIVER_LINK] = { 0 };

nlh = (struct nlmsghdr*)nltxbuffer;
nlh->nlmsg_type = nlfamily;
Expand Down Expand Up @@ -3336,9 +3336,9 @@ while(1)
if(nla->nla_type == NL80211_ATTR_WIPHY)
{
(ifpresentlist + ii)->wiphy = *((u32*)nla_data(nla));
snprintf(driverfmt, 64, "/sys/class/ieee80211/phy%d/device/driver", (ifpresentlist + ii)->wiphy);
memset(&driverlink, 0, 128);
if((dnlen = readlink(driverfmt, driverlink, 64)) > 0)
snprintf(driverfmt, DRIVER_FORMAT, "/sys/class/ieee80211/phy%d/device/driver", (ifpresentlist + ii)->wiphy);
memset(&driverlink, 0, DRIVER_LINK);
if((dnlen = readlink(driverfmt, driverlink, DRIVER_LINK)) > 0)
{
drivername = basename(driverlink);
if(drivername != NULL) strncpy((ifpresentlist + ii)->driver, drivername, DRIVERNAME_MAX -1);
Expand Down
4 changes: 4 additions & 0 deletions include/hcxdumptool.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@
#define EAPOLM2TIMEOUT 20000000ULL
#define EAPOLM3TIMEOUT 20000000ULL


#define DRIVER_FORMAT 128
#define DRIVER_LINK 128

#define RCAD_MAX 40

#define PROBERESPONSETX_MAX 5
Expand Down

0 comments on commit 1f018b8

Please sign in to comment.