diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-02-12 18:48:22 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-02-12 18:48:22 -0800 |
commit | 63d0029e2736ba0e965d5f8ac6f22aa77002e1bc (patch) | |
tree | a9743e4b422393822602c9aaf2b02e5f4affb7ea /print-ppi.c | |
parent | cc79646a9d793423cc0c0080d14bf1df53d366e8 (diff) | |
download | tcpdump-63d0029e2736ba0e965d5f8ac6f22aa77002e1bc.tar.gz |
Pass an adjusted struct pcap_pkthdr to the sub-printer.
The caplen and len of the packet it's printing must be reduced by the
length of the PPI header.
Diffstat (limited to 'print-ppi.c')
-rw-r--r-- | print-ppi.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/print-ppi.c b/print-ppi.c index ddf674d2..39571540 100644 --- a/print-ppi.c +++ b/print-ppi.c @@ -56,6 +56,7 @@ ppi_print(netdissect_options *ndo, uint16_t len; uint32_t dlt; uint32_t hdrlen; + struct pcap_pkthdr nhdr; if (caplen < sizeof(ppi_header_t)) { ND_PRINT((ndo, "[|ppi]")); @@ -86,7 +87,10 @@ ppi_print(netdissect_options *ndo, p += len; if ((printer = lookup_printer(dlt)) != NULL) { - hdrlen = printer(ndo, h, p); + nhdr = *h; + nhdr.caplen = caplen; + nhdr.len = length; + hdrlen = printer(ndo, &nhdr, p); } else { if (!ndo->ndo_eflag) ppi_header_print(ndo, (const u_char *)hdr, length + len); |