diff options
author | dlg <dlg@openbsd.org> | 2018-02-06 03:07:51 +0000 |
---|---|---|
committer | dlg <dlg@openbsd.org> | 2018-02-06 03:07:51 +0000 |
commit | c834ed88303ceeffea5e7d9fbae6c9901064aff9 (patch) | |
tree | 84a240da865c5aa3383f6990b20cf4edfc9ecb71 /usr.sbin/tcpdump/print-ip.c | |
parent | recognise DLT_PPP_SERIAL. (diff) | |
download | wireguard-openbsd-c834ed88303ceeffea5e7d9fbae6c9901064aff9.tar.xz wireguard-openbsd-c834ed88303ceeffea5e7d9fbae6c9901064aff9.zip |
rework ppp, pptp, and gre parsing.
this started cos i was looking at pptp, which came out like this:
23:52:00.197893 call 24 seq 7: gre-ppp-payload (gre encap)
23:52:00.198930 call 1 seq 7 ack 7: gre-ppp-payload (gre encap)
now it looks like this:
23:52:00.197893 20.0.0.2 > 20.0.0.1: pptp callid 24 seq 7: 17.1.1.122 > 40.0.0.2: icmp: echo request
23:52:00.198930 20.0.0.1 > 20.0.0.2: pptp callid 1 seq 7 ack 7: 40.0.0.2 > 17.1.1.122: icmp: echo reply
the big improvement in ppp parsing is it stops parsing based on
what the ppp headers say, rather than what bytes have been captured.
this also adds parsing of EAP packets.
DLT_PPP_SERIAL is now recognised and printed. gre now prints the
outer addresses always, not just when it's encapsulated by ipv6 or
-v is passed to tcpdump.
ok sthen@
Diffstat (limited to 'usr.sbin/tcpdump/print-ip.c')
-rw-r--r-- | usr.sbin/tcpdump/print-ip.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/usr.sbin/tcpdump/print-ip.c b/usr.sbin/tcpdump/print-ip.c index 254ace611fc..b433cbb7678 100644 --- a/usr.sbin/tcpdump/print-ip.c +++ b/usr.sbin/tcpdump/print-ip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ip.c,v 1.47 2016/10/30 04:10:21 jsg Exp $ */ +/* $OpenBSD: print-ip.c,v 1.48 2018/02/06 03:07:51 dlg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -497,16 +497,11 @@ ip_print(const u_char *bp, u_int length) #define IPPROTO_GRE 47 #endif case IPPROTO_GRE: - if (vflag) - (void)printf("gre %s > %s: ", - ipaddr_string(&ip->ip_src), - ipaddr_string(&ip->ip_dst)); + (void)printf("%s > %s: ", + ipaddr_string(&ip->ip_src), + ipaddr_string(&ip->ip_dst)); /* do it */ gre_print(cp, len); - if (! vflag) { - printf(" (gre encap)"); - goto out; - } break; #ifndef IPPROTO_ESP |