diff options
author | cy <cy@FreeBSD.org> | 2017-09-06 01:38:01 +0000 |
---|---|---|
committer | cy <cy@FreeBSD.org> | 2017-09-06 01:38:01 +0000 |
commit | 9abef2b6509242881ac424053c047cbabd74f998 (patch) | |
tree | 8691a7c8b9cbe3e7bbb8d2cd632a4789b47a9127 | |
parent | eff5ab555a27ad534108415e8ab98b8e8a359e35 (diff) | |
download | FreeBSD-src-9abef2b6509242881ac424053c047cbabd74f998.zip FreeBSD-src-9abef2b6509242881ac424053c047cbabd74f998.tar.gz |
MFC r322073:
Fix matchcing of NATed ICMP queries (resolving NATed MTU discovery).
-rw-r--r-- | sys/contrib/ipfilter/netinet/ip_nat.c | 19 |
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 9ef170d..0fbd124 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat.c +++ b/sys/contrib/ipfilter/netinet/ip_nat.c @@ -4100,13 +4100,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; @@ -4426,8 +4421,6 @@ ipf_nat_outlookup(fin, flags, p, src, dst) ifp = fin->fin_ifp; sflags = flags & IPN_TCPUDPICMP; - sport = 0; - dport = 0; switch (p) { @@ -4437,12 +4430,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; } |