summaryrefslogtreecommitdiff
path: root/usr.sbin/tcpdump/print-llc.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2023-02-28 10:04:51 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2023-02-28 10:04:51 +0000
commitdfd222c04437e40cc6127c3f5e1dcb60051096dc (patch)
tree5f94ef78136aa1f2ef01a3a8febc0826b871656c /usr.sbin/tcpdump/print-llc.c
parentc4c0b193f4ca9ede3a6a9d5e1c353b3baa4c492c (diff)
Adjust default_print() to not run over snapend.
Kill default_print_unaligned() and adjust default_print() to also work with unaligned buffers. There is no need for two functions doing the same thing. Pass the right length in nsh_print to default_print(). Fixes on place that makes tcpdump crash. Reported by Peter J. Philipp (pjp at delphinusdns dot org) OK mbuhl@
Diffstat (limited to 'usr.sbin/tcpdump/print-llc.c')
-rw-r--r--usr.sbin/tcpdump/print-llc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/tcpdump/print-llc.c b/usr.sbin/tcpdump/print-llc.c
index 14829688033..ed48dc46a25 100644
--- a/usr.sbin/tcpdump/print-llc.c
+++ b/usr.sbin/tcpdump/print-llc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-llc.c,v 1.22 2020/01/24 22:46:37 procter Exp $ */
+/* $OpenBSD: print-llc.c,v 1.23 2023/02/28 10:04:50 claudio Exp $ */
/*
* Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997
@@ -219,7 +219,7 @@ llc_print(const u_char *p, u_int length, u_int caplen,
printf("%s/%c", m, f);
if (caplen < 6) {
- default_print_unaligned(p, caplen);
+ default_print(p, caplen);
return (0);
}
p += 3;
@@ -248,7 +248,7 @@ llc_print(const u_char *p, u_int length, u_int caplen,
} else {
char f;
if (caplen < 4) {
- default_print_unaligned(p, caplen);
+ default_print(p, caplen);
return (0);
}
llc.llcis = ntohs(llc.llcis);