summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2018-02-06 03:41:59 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2018-02-06 03:41:59 +0000
commit56b50f87416aff71d1e49d26311635b2b0941d72 (patch)
tree8179504ae7e6332a10539957258f03b72948a730
parent9ca1f757049878277b23a9eaff11ffe53cc03736 (diff)
output the data part of LCP Echo-Request and Echo-Reply packets.
-rw-r--r--usr.sbin/tcpdump/print-ppp.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/usr.sbin/tcpdump/print-ppp.c b/usr.sbin/tcpdump/print-ppp.c
index 40692371440..ec13ff496eb 100644
--- a/usr.sbin/tcpdump/print-ppp.c
+++ b/usr.sbin/tcpdump/print-ppp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ppp.c,v 1.31 2018/02/06 03:07:51 dlg Exp $ */
+/* $OpenBSD: print-ppp.c,v 1.32 2018/02/06 03:41:58 dlg Exp $ */
/*
* Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997
@@ -441,6 +441,7 @@ static void
handle_lcp(const u_char *p, int l)
{
struct ppp_control pc;
+ int i;
if (ppp_cp_header(&pc, p, l, &ppp_cp_lcp) == -1)
goto trunc;
@@ -474,6 +475,23 @@ handle_lcp(const u_char *p, int l)
if (l < 4)
goto trunc;
printf(" Magic-Number=%u", EXTRACT_32BITS(p));
+ p += 4;
+ l -= 4;
+
+ i = sizeof(pc) + 4;
+ if (i == pc.len)
+ break;
+
+ printf(" Data=");
+ do {
+ if (l == 0)
+ goto trunc;
+
+ printf("%02x", *p);
+
+ p++;
+ l--;
+ } while (++i < pc.len);
break;
case LCP_TERM_REQ:
case LCP_TERM_ACK: