From afdfad047fe500d4910187dc64ccdf12a0bafb28 Mon Sep 17 00:00:00 2001 From: dlg Date: Thu, 3 Jun 2021 04:47:54 +0000 Subject: [PATCH] ip6_input_if used the ip6_hdr pointer uninitted after i refactored it. i did test this, but i guess i was lucky. very lucky. Coverity CID 1505114 --- sys/netinet6/ip6_input.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 3e4cd189b54..4ddc3e998da 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_input.c,v 1.236 2021/06/02 00:27:03 dlg Exp $ */ +/* $OpenBSD: ip6_input.c,v 1.237 2021/06/03 04:47:54 dlg Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -285,6 +285,8 @@ ip6_input_if(struct mbuf **mp, int *offp, int nxt, int af, struct ifnet *ifp) if (m == NULL) goto bad; + ip6 = mtod(m, struct ip6_hdr *); + #if NCARP > 0 if (carp_lsdrop(ifp, m, AF_INET6, ip6->ip6_src.s6_addr32, ip6->ip6_dst.s6_addr32, (ip6->ip6_nxt == IPPROTO_ICMPV6 ? 0 : 1))) -- 2.20.1