diff options
| author | Subhani Shaik <subhanis@qca.qualcomm.com> | 2014-02-15 19:58:33 -0800 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-02-20 21:42:17 -0800 |
| commit | e389a29bf810c76e64cb0c1b185a01dc21ebe00d (patch) | |
| tree | 403260d14adc499567d8d11d26c4a5eb3aa83ae8 /tools/fwdebuglog | |
| parent | 516dedb499ad87ebd9053e000b7ee7dbec21a647 (diff) | |
Fix cnss-diag for file based logging.
cnss-diag broke the file based logging where the right pointer to
the buff was not passed causing invalid log messages.
Change-Id: Ia4581440bc84dd0a484c2b7d31455fa8d5ee831e
CRs-fixed: 616488
Diffstat (limited to 'tools/fwdebuglog')
| -rw-r--r-- | tools/fwdebuglog/cld-fwlog-netlink.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/fwdebuglog/cld-fwlog-netlink.c b/tools/fwdebuglog/cld-fwlog-netlink.c index 1fbd9789723a..1114d42747b5 100644 --- a/tools/fwdebuglog/cld-fwlog-netlink.c +++ b/tools/fwdebuglog/cld-fwlog-netlink.c @@ -252,7 +252,7 @@ static void stop(int signum) int main(int argc, char *argv[]) { - int res =0; + unsigned int res =0; unsigned char *eventbuf; unsigned char *dbgbuf; int c, rc = 0; @@ -409,7 +409,7 @@ int main(int argc, char *argv[]) continue; } slot = (struct dbglog_slot *)dbgbuf; - timestamp = get_le32((unsigned char *)&slot->length); + timestamp = get_le32((unsigned char *)&slot->timestamp); length = get_le32((unsigned char *)&slot->length); dropped = get_le32((unsigned char *)&slot->dropped); if (!((optionflag & SILENT_FLAG) == SILENT_FLAG)) { @@ -418,7 +418,9 @@ int main(int argc, char *argv[]) timestamp, length, dropped); } fseek(log_out, record * RECLEN, SEEK_SET); - if ((res = fwrite(dbgbuf, RECLEN, 1, log_out)) != 1){ + /* Diag type is not required so +4 */ + if ((res = fwrite((dbgbuf+sizeof(slot->diag_type)), RECLEN, + 1, log_out)) != 1){ perror("fwrite"); break; } |
