From owner-svn-src-stable-10@freebsd.org Wed Sep 6 20:01:21 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 606FCE14106; Wed, 6 Sep 2017 20:01:21 +0000 (UTC) (envelope-from cy@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 mx1.freebsd.org (Postfix) with ESMTPS id C7E367158E; Wed, 6 Sep 2017 20:01:20 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v86K1JV8024733; Wed, 6 Sep 2017 20:01:19 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86K1Jri024732; Wed, 6 Sep 2017 20:01:19 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201709062001.v86K1Jri024732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 6 Sep 2017 20:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r323231 - stable/10/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/10/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 323231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Sep 2017 20:01:21 -0000 Author: cy Date: Wed Sep 6 20:01:19 2017 New Revision: 323231 URL: https://svnweb.freebsd.org/changeset/base/323231 Log: MFC r322073: Fix matchcing of NATed ICMP queries (resolving NATed MTU discovery). Approved by: re (kib) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Wed Sep 6 17:19:48 2017 (r323230) +++ stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Wed Sep 6 20:01:19 2017 (r323231) @@ -4105,13 +4105,8 @@ ipf_nat_inlookup(fin, flags, p, src, mapdst) dport = htons(fin->fin_data[1]); break; case IPPROTO_ICMP : - if (flags & IPN_ICMPERR) { - sport = fin->fin_data[1]; - dport = 0; - } else { - dport = fin->fin_data[1]; - sport = 0; - } + sport = 0; + dport = fin->fin_data[1]; break; default : sport = 0; @@ -4431,8 +4426,6 @@ ipf_nat_outlookup(fin, flags, p, src, dst) ifp = fin->fin_ifp; sflags = flags & IPN_TCPUDPICMP; - sport = 0; - dport = 0; switch (p) { @@ -4442,12 +4435,12 @@ ipf_nat_outlookup(fin, flags, p, src, dst) dport = htons(fin->fin_data[1]); break; case IPPROTO_ICMP : - if (flags & IPN_ICMPERR) - sport = fin->fin_data[1]; - else - dport = fin->fin_data[1]; + sport = 0; + dport = fin->fin_data[1]; break; default : + sport = 0; + dport = 0; break; }