diff options
author | Hakan Olsson <ho@cvs.openbsd.org> | 2004-06-22 03:19:54 +0000 |
---|---|---|
committer | Hakan Olsson <ho@cvs.openbsd.org> | 2004-06-22 03:19:54 +0000 |
commit | 938285083a56a402ec9ed4887a8d271792a37631 (patch) | |
tree | e936c343a51881c8d85544c852125daa16ec3cb9 /usr.sbin | |
parent | ecf989c68adb740e98adc7c4994c82995eddf17e (diff) |
Recognize NAT-T Keepalive packets. markus@ ok.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/tcpdump/print-udpencap.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/tcpdump/print-udpencap.c b/usr.sbin/tcpdump/print-udpencap.c index e6c3900fa7e..27ceb326dfd 100644 --- a/usr.sbin/tcpdump/print-udpencap.c +++ b/usr.sbin/tcpdump/print-udpencap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-udpencap.c,v 1.1 2003/06/11 20:58:45 markus Exp $ */ +/* $OpenBSD: print-udpencap.c,v 1.2 2004/06/22 03:19:53 ho Exp $ */ /* * Copyright (c) 2003 Markus Friedl. All rights reserved. @@ -26,7 +26,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-udpencap.c,v 1.1 2003/06/11 20:58:45 markus Exp $ (XXX)"; + "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-udpencap.c,v 1.2 2004/06/22 03:19:53 ho Exp $ (XXX)"; #endif #include <sys/types.h> @@ -39,13 +39,19 @@ udpencap_print(const u_char *bp, u_int len, const u_char *bp2) { u_int32_t *spi; + /* Recognize NAT-T Keepalive msgs. (draft-ietf-ipsec-udp-encaps-nn) */ + if (len == 1 && *bp == 0xFF) { + fputs(" NAT-T Keepalive", stdout); + return; + } + if (len < sizeof(u_int32_t)) { fputs(" [|udpencap]", stdout); return; } if (vflag) (void)printf(" "); - (void)printf("udpencap: "); + (void)printf("udpencap:"); spi = (u_int32_t *)(bp); if (*spi == 0) ike_print(bp + sizeof(u_int32_t), len - sizeof(u_int32_t)); |