Fix null pointer dereference in pf_route6(). Embedding scope into
authorbluhm <bluhm@openbsd.org>
Fri, 12 Feb 2021 13:48:31 +0000 (13:48 +0000)
committerbluhm <bluhm@openbsd.org>
Fri, 12 Feb 2021 13:48:31 +0000 (13:48 +0000)
addresses that come from pf cannot be right, so remove the code.
Coverity CID 1501718
OK dlg@ claudio@

sys/net/pf.c

index 74ec0aa..be76937 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pf.c,v 1.1108 2021/02/04 00:55:41 sashan Exp $ */
+/*     $OpenBSD: pf.c,v 1.1109 2021/02/12 13:48:31 bluhm Exp $ */
 
 /*
  * Copyright (c) 2001 Daniel Hartmeier
@@ -6156,8 +6156,6 @@ pf_route6(struct pf_pdesc *pd, struct pf_state *s)
        dst->sin6_addr = s->rt_addr.v6;
        rtableid = m0->m_pkthdr.ph_rtableid;
 
-       if (IN6_IS_SCOPE_EMBED(&dst->sin6_addr))
-               dst->sin6_addr.s6_addr16[1] = htons(ifp->if_index);
        rt = rtalloc(sin6tosa(dst), RT_RESOLVE, rtableid);
        if (!rtisvalid(rt)) {
                if (s->rt != PF_DUPTO) {