mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-24 02:23:27 +08:00
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.
This commit is contained in:
parent
cc79646a9d
commit
63d0029e27
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user