summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2023-03-03 13:03:30 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2023-03-03 13:03:30 +0000
commit1b19c0bdee7343bd192d8a1ce03411d818d45d53 (patch)
tree9eb705c692593bc7b5297d29dff972a27d3064e4 /usr.sbin
parentbfbe7b85f753184fc4f71fc3ed3c17424035d63c (diff)
Use EXTRACT_16BITS() in default_print() instead of handrolling it.
OK bluhm@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/tcpdump/tcpdump.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/tcpdump/tcpdump.c b/usr.sbin/tcpdump/tcpdump.c
index 336f4efbf3d..d68df1a7c3f 100644
--- a/usr.sbin/tcpdump/tcpdump.c
+++ b/usr.sbin/tcpdump/tcpdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcpdump.c,v 1.98 2023/02/28 10:04:50 claudio Exp $ */
+/* $OpenBSD: tcpdump.c,v 1.99 2023/03/03 13:03:29 claudio Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -55,6 +55,7 @@
#include <sys/socket.h>
#include <net/if.h>
#include <net/pfvar.h>
+#include "extract.h"
#include "pfctl.h"
#include "pfctl_parser.h"
#include "privsep.h"
@@ -657,8 +658,8 @@ default_print(const u_char *bp, u_int length)
if ((i++ % 8) == 0)
printf("\n\t\t\t");
- sp = (u_short)*bp++ << 8;
- sp |= *bp++;
+ sp = EXTRACT_16BITS(bp);
+ bp += sizeof(sp);
printf(" %04x", sp);
}
if (length & 1) {