diff options
Diffstat (limited to 'usr.sbin/tcpdump/print-ip6.c')
| -rw-r--r-- | usr.sbin/tcpdump/print-ip6.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/tcpdump/print-ip6.c b/usr.sbin/tcpdump/print-ip6.c index 79dc408e0fe..c05cabeb840 100644 --- a/usr.sbin/tcpdump/print-ip6.c +++ b/usr.sbin/tcpdump/print-ip6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ip6.c,v 1.5 2004/02/04 08:35:12 otto Exp $ */ +/* $OpenBSD: print-ip6.c,v 1.6 2005/10/08 19:24:03 canacar Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 @@ -100,6 +100,10 @@ ip6_print(register const u_char *bp, register int length) (void)printf("truncated-ip6 %d", length); return; } + if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) { + (void)printf("bad-ip6-version %u", ip6->ip6_vfc >> 4); + return; + } hlen = sizeof(struct ip6_hdr); len = ntohs(ip6->ip6_plen); |
