mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-08 13:28:05 +00:00
Fix matchcing of NATed ICMP queries (resolving NATed MTU discovery).
MFC after: 1 month
This commit is contained in:
parent
fdf2bc100e
commit
a3329e0129
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=322073
@ -4100,13 +4100,8 @@ ipf_nat_inlookup(fin, flags, p, src, mapdst)
|
|||||||
dport = htons(fin->fin_data[1]);
|
dport = htons(fin->fin_data[1]);
|
||||||
break;
|
break;
|
||||||
case IPPROTO_ICMP :
|
case IPPROTO_ICMP :
|
||||||
if (flags & IPN_ICMPERR) {
|
sport = 0;
|
||||||
sport = fin->fin_data[1];
|
dport = fin->fin_data[1];
|
||||||
dport = 0;
|
|
||||||
} else {
|
|
||||||
dport = fin->fin_data[1];
|
|
||||||
sport = 0;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
sport = 0;
|
sport = 0;
|
||||||
@ -4426,8 +4421,6 @@ ipf_nat_outlookup(fin, flags, p, src, dst)
|
|||||||
|
|
||||||
ifp = fin->fin_ifp;
|
ifp = fin->fin_ifp;
|
||||||
sflags = flags & IPN_TCPUDPICMP;
|
sflags = flags & IPN_TCPUDPICMP;
|
||||||
sport = 0;
|
|
||||||
dport = 0;
|
|
||||||
|
|
||||||
switch (p)
|
switch (p)
|
||||||
{
|
{
|
||||||
@ -4437,12 +4430,12 @@ ipf_nat_outlookup(fin, flags, p, src, dst)
|
|||||||
dport = htons(fin->fin_data[1]);
|
dport = htons(fin->fin_data[1]);
|
||||||
break;
|
break;
|
||||||
case IPPROTO_ICMP :
|
case IPPROTO_ICMP :
|
||||||
if (flags & IPN_ICMPERR)
|
sport = 0;
|
||||||
sport = fin->fin_data[1];
|
dport = fin->fin_data[1];
|
||||||
else
|
|
||||||
dport = fin->fin_data[1];
|
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
|
sport = 0;
|
||||||
|
dport = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user