From owner-svn-src-head@freebsd.org Thu Apr 2 20:16:11 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 B4A1B26385B; Thu, 2 Apr 2020 20:16:11 +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 48tZ8B4KtXz4Q3r; Thu, 2 Apr 2020 20:16:10 +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 EF4ED1F28C; Thu, 2 Apr 2020 20:06:37 +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 032K6bJ7043397; Thu, 2 Apr 2020 20:06:37 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 032K6bOb043396; Thu, 2 Apr 2020 20:06:37 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202004022006.032K6bOb043396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 2 Apr 2020 20:06:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359580 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 359580 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: Thu, 02 Apr 2020 20:16:11 -0000 Author: melifaro Date: Thu Apr 2 20:06:37 2020 New Revision: 359580 URL: https://svnweb.freebsd.org/changeset/base/359580 Log: Use interface fib for proxyarp checks. Before the change, proxyarp checks for src and dst addresses were performed using default fib, breaking multi-fib scenario. PR: 245181 Submitted by: Scott Aitken (original version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24244 Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Thu Apr 2 20:02:33 2020 (r359579) +++ head/sys/netinet/if_ether.c Thu Apr 2 20:06:37 2020 (r359580) @@ -1044,7 +1044,11 @@ reply: (void)memcpy(ar_tha(ah), ar_sha(ah), ah->ar_hln); (void)memcpy(ar_sha(ah), enaddr, ah->ar_hln); } else { - struct llentry *lle = NULL; + /* + * Destination address is not ours. Check if + * proxyarp entry exists or proxyarp is turned on globally. + */ + struct llentry *lle; sin.sin_addr = itaddr; lle = lla_lookup(LLTABLE(ifp), 0, (struct sockaddr *)&sin); @@ -1061,8 +1065,8 @@ reply: if (!V_arp_proxyall) goto drop; - /* XXX MRT use table 0 for arp reply */ - if (fib4_lookup_nh_basic(0, itaddr, 0, 0, &nh4) != 0) + if (fib4_lookup_nh_basic(ifp->if_fib, itaddr, 0, 0, + &nh4) != 0) goto drop; /* @@ -1083,8 +1087,8 @@ reply: * wrong network. */ - /* XXX MRT use table 0 for arp checks */ - if (fib4_lookup_nh_basic(0, isaddr, 0, 0, &nh4) != 0) + if (fib4_lookup_nh_basic(ifp->if_fib, isaddr, 0, 0, + &nh4) != 0) goto drop; if (nh4.nh_ifp != ifp) { ARP_LOG(LOG_INFO, "proxy: ignoring request"