From 8cf626bf16074b1d6309c0b982c215dbf9e6364e Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 21 Jul 2020 14:29:31 -0700 Subject: [PATCH] nettl: user IDs are 32-bit in HP-UX. Also note that the record header might have additional stuff at the end, although not all record headers do (the header length will indicate what's there). Change-Id: I5a9ff1f9cd592448bcc45d18808f4b651cdb2f0d Reviewed-on: https://code.wireshark.org/review/37921 Petri-Dish: Guy Harris Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris --- epan/dissectors/packet-nettl.c | 2 +- wiretap/nettl.c | 7 ++++--- wiretap/wtap.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/epan/dissectors/packet-nettl.c b/epan/dissectors/packet-nettl.c index b307b73b6f..76d9d23288 100644 --- a/epan/dissectors/packet-nettl.c +++ b/epan/dissectors/packet-nettl.c @@ -296,7 +296,7 @@ proto_register_nettl(void) "HP-UX Process/thread id", HFILL}}, { &hf_nettl_uid, - { "User ID (uid)", "nettl.uid", FT_UINT16, BASE_DEC, NULL, 0x0, + { "User ID (uid)", "nettl.uid", FT_UINT32, BASE_DEC, NULL, 0x0, "HP-UX User ID", HFILL}} }; diff --git a/wiretap/nettl.c b/wiretap/nettl.c index 10301c7c15..f3b2699b72 100644 --- a/wiretap/nettl.c +++ b/wiretap/nettl.c @@ -61,8 +61,9 @@ struct nettlrec_hdr { guint32 sec; guint32 usec; guint32 pid; - guint8 xxc[10]; - guint16 uid; + guint8 xxc[8]; + guint32 uid; + /* Other stuff might be here, but isn't always here */ }; /* @@ -554,7 +555,7 @@ nettl_read_rec(wtap *wth, FILE_T fh, wtap_rec *rec, Buffer *buf, pseudo_header->nettl.devid = pntoh32(&rec_hdr.devid); pseudo_header->nettl.kind = pntoh32(&rec_hdr.kind); pseudo_header->nettl.pid = pntoh32(&rec_hdr.pid); - pseudo_header->nettl.uid = pntoh16(&rec_hdr.uid); + pseudo_header->nettl.uid = pntoh32(&rec_hdr.uid); if (rec->rec_header.packet_header.caplen > WTAP_MAX_PACKET_SIZE_STANDARD) { /* diff --git a/wiretap/wtap.h b/wiretap/wtap.h index 21a1dfe57a..d0fc590ef5 100644 --- a/wiretap/wtap.h +++ b/wiretap/wtap.h @@ -941,7 +941,7 @@ struct nettl_phdr { guint32 devid; guint32 kind; gint32 pid; - guint16 uid; + guint32 uid; }; /* Packet "pseudo-header" for MTP2 files. */