Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Sep 2017 20:01:19 +0000 (UTC)
From:      Cy Schubert <cy@FreeBSD.org>
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
Message-ID:  <201709062001.v86K1Jri024732@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709062001.v86K1Jri024732>