From owner-svn-src-head@freebsd.org Sun Apr 19 07:27:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 596362BCAAD; Sun, 19 Apr 2020 07:27:13 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 494hH51Slmz3Gl5; Sun, 19 Apr 2020 07:27:13 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 290FA22180; Sun, 19 Apr 2020 07:27:13 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 03J7RDeq038739; Sun, 19 Apr 2020 07:27:13 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03J7RDPC038738; Sun, 19 Apr 2020 07:27:13 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202004190727.03J7RDPC038738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 19 Apr 2020 07:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360090 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 360090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Apr 2020 07:27:13 -0000 Author: melifaro Date: Sun Apr 19 07:27:12 2020 New Revision: 360090 URL: https://svnweb.freebsd.org/changeset/base/360090 Log: Fix lookup key generation in fib6_check_urpf(). The version introduced in r359823 assumed D23051 had been in tree already. As this is not the case yet, revert to sockaddr. Modified: head/sys/netinet6/in6_fib.c Modified: head/sys/netinet6/in6_fib.c ============================================================================== --- head/sys/netinet6/in6_fib.c Sun Apr 19 02:49:05 2020 (r360089) +++ head/sys/netinet6/in6_fib.c Sun Apr 19 07:27:12 2020 (r360090) @@ -362,7 +362,7 @@ fib6_check_urpf(uint32_t fibnum, const struct in6_addr struct rib_head *rh; struct radix_node *rn; struct rtentry *rt; - struct in6_addr addr; + struct sockaddr_in6 sin6; int ret; KASSERT((fibnum < rt_numfibs), ("fib6_check_urpf: bad fibnum")); @@ -370,13 +370,18 @@ fib6_check_urpf(uint32_t fibnum, const struct in6_addr if (rh == NULL) return (0); - addr = *dst6; + /* TODO: radix changes */ + /* Prepare lookup key */ + memset(&sin6, 0, sizeof(sin6)); + sin6.sin6_len = sizeof(struct sockaddr_in6); + sin6.sin6_addr = *dst6; + /* Assume scopeid is valid and embed it directly */ if (IN6_IS_SCOPE_LINKLOCAL(dst6)) - addr.s6_addr16[1] = htons(scopeid & 0xffff); + sin6.sin6_addr.s6_addr16[1] = htons(scopeid & 0xffff); RIB_RLOCK(rh); - rn = rh->rnh_matchaddr((void *)&addr, &rh->head); + rn = rh->rnh_matchaddr((void *)&sin6, &rh->head); if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0)) { rt = RNTORT(rn); #ifdef RADIX_MPATH