summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2004-06-23 05:21:19 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2004-06-23 05:21:19 +0000
commitc5c2d218d250a98f3ee95559ec99c0c41eb1c0cc (patch)
treea8c88a054cae54f2b9621c3d73570807a5a7f8dc /usr.sbin
parent528bd53c0cc743655a6747db3a4d672c6098ca67 (diff)
pretty print; ok ho@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/tcpdump/print-udpencap.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.sbin/tcpdump/print-udpencap.c b/usr.sbin/tcpdump/print-udpencap.c
index 27ceb326dfd..c792670063b 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.2 2004/06/22 03:19:53 ho Exp $ */
+/* $OpenBSD: print-udpencap.c,v 1.3 2004/06/23 05:21:18 markus 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.2 2004/06/22 03:19:53 ho Exp $ (XXX)";
+ "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-udpencap.c,v 1.3 2004/06/23 05:21:18 markus Exp $ (XXX)";
#endif
#include <sys/types.h>
@@ -41,7 +41,9 @@ udpencap_print(const u_char *bp, u_int len, const u_char *bp2)
/* Recognize NAT-T Keepalive msgs. (draft-ietf-ipsec-udp-encaps-nn) */
if (len == 1 && *bp == 0xFF) {
- fputs(" NAT-T Keepalive", stdout);
+ if (vflag)
+ fputs(" ", stdout);
+ fputs("NAT-T Keepalive", stdout);
return;
}
@@ -50,11 +52,13 @@ udpencap_print(const u_char *bp, u_int len, const u_char *bp2)
return;
}
if (vflag)
- (void)printf(" ");
- (void)printf("udpencap:");
+ fputs(" ", stdout);
+ fputs("udpencap:", stdout);
spi = (u_int32_t *)(bp);
if (*spi == 0)
ike_print(bp + sizeof(u_int32_t), len - sizeof(u_int32_t));
- else
+ else {
+ fputs(" ", stdout);
esp_print(bp, len, bp2);
+ }
}