summaryrefslogtreecommitdiff
path: root/print-ppp.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2022-03-07 15:09:43 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2022-03-07 15:32:07 +0100
commit68f6ee780dd1d63f66ec576b52c5e177e89d1f55 (patch)
tree8e699baf6e0ced05b82198b1d260056ce513c539 /print-ppp.c
parent68218acff78a154f69b1a055096b6f949ca58c88 (diff)
downloadtcpdump-68f6ee780dd1d63f66ec576b52c5e177e89d1f55.tar.gz
PPP: Change the pointer to packet data
Thus it can be used for debugging.
Diffstat (limited to 'print-ppp.c')
-rw-r--r--print-ppp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/print-ppp.c b/print-ppp.c
index baeb4f00..76494410 100644
--- a/print-ppp.c
+++ b/print-ppp.c
@@ -1363,7 +1363,7 @@ ppp_hdlc(netdissect_options *ndo,
u_char *b, *t, c;
const u_char *s;
u_int i, proto;
- const void *se;
+ const void *sb, *se;
if (caplen == 0)
return;
@@ -1395,8 +1395,11 @@ ppp_hdlc(netdissect_options *ndo,
/*
* Change the end pointer, so bounds checks work.
+ * Change the pointer to packet data to help debugging.
*/
+ sb = ndo->ndo_packetp;
se = ndo->ndo_snapend;
+ ndo->ndo_packetp = b;
ndo->ndo_snapend = t;
length = ND_BYTES_AVAILABLE_AFTER(b);
@@ -1433,10 +1436,12 @@ ppp_hdlc(netdissect_options *ndo,
}
cleanup:
+ ndo->ndo_packetp = sb;
ndo->ndo_snapend = se;
return;
trunc:
+ ndo->ndo_packetp = sb;
ndo->ndo_snapend = se;
nd_print_trunc(ndo);
}