summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authorcy <cy@FreeBSD.org>2017-09-06 20:01:19 +0000
committercy <cy@FreeBSD.org>2017-09-06 20:01:19 +0000
commit1b19abe547cd66ae0d84abdb7da2efb40a5c42a4 (patch)
tree4169f4d5095eb4c0dd01bf28ffebd8a482a59379 /sys/contrib
parent7a3c22b9453334f7f9ccf51c8caf9926442af27b (diff)
downloadFreeBSD-src-1b19abe547cd66ae0d84abdb7da2efb40a5c42a4.zip
FreeBSD-src-1b19abe547cd66ae0d84abdb7da2efb40a5c42a4.tar.gz
MFC r322073:
Fix matchcing of NATed ICMP queries (resolving NATed MTU discovery). Approved by: re (kib)
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/ipfilter/netinet/ip_nat.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/sys/contrib/ipfilter/netinet/ip_nat.c b/sys/contrib/ipfilter/netinet/ip_nat.c
index 42f0d00..c0abc9d 100644
--- a/sys/contrib/ipfilter/netinet/ip_nat.c
+++ b/sys/contrib/ipfilter/netinet/ip_nat.c
@@ -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;
}
OpenPOWER on IntegriCloud