summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tcpdump/print-ether.c
diff options
context:
space:
mode:
authorprocter <procter@openbsd.org>2020-01-24 22:46:36 +0000
committerprocter <procter@openbsd.org>2020-01-24 22:46:36 +0000
commitf96bb33f4775ce2a1279cb96ebaecb010eb3bdc3 (patch)
tree9b2ab0af0e72e725c026e33cb8dd0226e3808486 /usr.sbin/tcpdump/print-ether.c
parentAdd FILES sections; OK espie@ solene@. (diff)
downloadwireguard-openbsd-f96bb33f4775ce2a1279cb96ebaecb010eb3bdc3.tar.xz
wireguard-openbsd-f96bb33f4775ce2a1279cb96ebaecb010eb3bdc3.zip
- (void)printf() -> printf(); the cast adds clutter for little value.
- fprintf(stdout, ...) -> printf() - fputs(x, stdout) -> printf(); for consistency. fputs is twice as fast on atom x5-Z8300@1.44GHz but Amdahl sees a pure printf tcpdump only 2% slower than a pure fputs (for constant strings) tcpdump to /dev/null across a 20MB/~170k packet pcap file. ok dlg@ for fputs and ok tedu@ krw@ deraadt@ a2k19 for the rest
Diffstat (limited to 'usr.sbin/tcpdump/print-ether.c')
-rw-r--r--usr.sbin/tcpdump/print-ether.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/usr.sbin/tcpdump/print-ether.c b/usr.sbin/tcpdump/print-ether.c
index 46aef01cebe..773fbb828fa 100644
--- a/usr.sbin/tcpdump/print-ether.c
+++ b/usr.sbin/tcpdump/print-ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ether.c,v 1.36 2019/12/03 01:43:33 dlg Exp $ */
+/* $OpenBSD: print-ether.c,v 1.37 2020/01/24 22:46:36 procter Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -60,17 +60,17 @@ ether_print(const u_char *bp, u_int length)
ep = (const struct ether_header *)bp;
if (qflag) {
TCHECK2(*ep, 12);
- (void)printf("%s %s %d: ",
- etheraddr_string(ESRC(ep)),
- etheraddr_string(EDST(ep)),
- length);
+ printf("%s %s %d: ",
+ etheraddr_string(ESRC(ep)),
+ etheraddr_string(EDST(ep)),
+ length);
} else {
TCHECK2(*ep, 14);
- (void)printf("%s %s %s %d: ",
- etheraddr_string(ESRC(ep)),
- etheraddr_string(EDST(ep)),
- etherproto_string(ep->ether_type),
- length);
+ printf("%s %s %s %d: ",
+ etheraddr_string(ESRC(ep)),
+ etheraddr_string(EDST(ep)),
+ etherproto_string(ep->ether_type),
+ length);
}
return;
trunc:
@@ -243,7 +243,7 @@ recurse:
case ETHERTYPE_ATALK:
if (vflag)
- fputs("et1 ", stdout);
+ printf("et1 ");
atalk_print_llap(p, length);
return (1);