diff options
author | Jakob Schlyter <jakob@cvs.openbsd.org> | 2000-01-16 11:43:59 +0000 |
---|---|---|
committer | Jakob Schlyter <jakob@cvs.openbsd.org> | 2000-01-16 11:43:59 +0000 |
commit | 309e3f7a5c479705e2d7447ebe30c607003943bf (patch) | |
tree | 2fae229cda02c88bb839c0117d290b61af3f6502 /usr.sbin/tcpdump/print-tcp.c | |
parent | 8864887c13971cbce8835d4e5a74294d0de7c8fa (diff) |
BGP support (from KAME/WIDE). INET6 parts not done yet.
Diffstat (limited to 'usr.sbin/tcpdump/print-tcp.c')
-rw-r--r-- | usr.sbin/tcpdump/print-tcp.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/usr.sbin/tcpdump/print-tcp.c b/usr.sbin/tcpdump/print-tcp.c index 0d5aa025f04..c0646b9dee3 100644 --- a/usr.sbin/tcpdump/print-tcp.c +++ b/usr.sbin/tcpdump/print-tcp.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-tcp.c,v 1.9 1999/11/26 18:16:55 provos Exp $ (LBL)"; + "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-tcp.c,v 1.10 2000/01/16 11:43:58 jakob Exp $ (LBL)"; #endif #include <sys/param.h> @@ -381,6 +381,19 @@ tcp_print(register const u_char *bp, register u_int length, } putchar('>'); } + + if (length <= 0) + return; + + /* + * Decode payload if necessary. + */ +#ifndef BGP_PORT +#define BGP_PORT 179 +#endif + bp += (tp->th_off * 4); + if (sport == BGP_PORT || dport == BGP_PORT) + bgp_print(bp, length); return; bad: fputs("[bad opt]", stdout); |