Skip to content

Commit

Permalink
tcpdump-100.100.2
Browse files Browse the repository at this point in the history
Imported from tcpdump-100.100.2.tar.gz
  • Loading branch information
AppleOSSDistributions committed Oct 6, 2021
1 parent 58ce3b9 commit 5c12708
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
20 changes: 15 additions & 5 deletions tcpdump/print-ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1367,19 +1367,29 @@ print_bacp_config_options(netdissect_options *ndo,
return 0;
}

/*
* Un-escape RFC 1662 PPP in HDLC-like framing, with octet escapes.
* The length argument is the on-the-wire length, not the captured
* length; we can only un-escape the captured part.
*/
static void
ppp_hdlc(netdissect_options *ndo,
const u_char *p, int length)
{
u_int caplen = ndo->ndo_snapend - p;
u_char *b, *t, c;
const u_char *s;
int i, proto;
u_int i;
int proto;
const void *se;

if (length <= 0)
if (caplen == 0)
return;

if (length == 0)
return;

b = (u_char *)malloc(length);
b = (u_char *)malloc(caplen);
if (b == NULL)
return;

Expand All @@ -1388,10 +1398,10 @@ ppp_hdlc(netdissect_options *ndo,
* Do this so that we dont overwrite the original packet
* contents.
*/
for (s = p, t = b, i = length; i > 0 && ND_TTEST(*s); i--) {
for (s = p, t = b, i = caplen; i > 0; i--) {
c = *s++;
if (c == 0x7d) {
if (i <= 1 || !ND_TTEST(*s))
if (i <= 1)
break;
i--;
c = *s++ ^ 0x20;
Expand Down
7 changes: 7 additions & 0 deletions tcpdump/print_pktap.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ pktap_if_print(struct netdissect_options *ndo, const struct pcap_pkthdr *h,
prsep));
prsep = ", ";
}
#ifdef PTH_FLAG_WAKE_PKT
if ((pktp_hdr->pth_flags & PTH_FLAG_WAKE_PKT)) {
ND_PRINT((ndo, "%s" "wk",
prsep));
prsep = ", ";
}
#endif /* PTH_FLAG_WAKE_PKT */
}
ND_PRINT((ndo, ") "));
}
Expand Down
7 changes: 7 additions & 0 deletions tcpdump/tcpdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -4004,6 +4004,13 @@ print_pcap_ng_block(u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
prsep));
prsep = ", ";
}
#ifdef PCAPNG_EPB_PMDF_WAKE_PKT
if ((pmdflags & PCAPNG_EPB_PMDF_WAKE_PKT)) {
ND_PRINT((ndo, "%s" "wk",
prsep));
prsep = ", ";
}
#endif /* PCAPNG_EPB_PMDF_WAKE_PKT */
}

/*
Expand Down

0 comments on commit 5c12708

Please # to comment.