mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
MFC 344f1083e1:
ipfilter: Use the softn (NAT softc) host map size in ip_nat6 calculation.
The ipfilter NAT table host map size is a tunable that defaults to
a macro value defined at build time. HOSTMAP_SIZE is saved in softn
(the ipnat softc) at initialization. It can be tuned (changed) at runtime
using the ipf -T command. If the hostmap_size tunable is adjusted the
calculation to determine where to put new entries in the table was
incorrect. Use the tunable in the NAT softc instead of the static build
time value.
(cherry picked from commit 344f1083e1)
This commit is contained in:
parent
5c32dfaaa1
commit
cee16a2ff0
1 changed files with 1 additions and 1 deletions
|
|
@ -390,7 +390,7 @@ ipf_nat6_hostmap(softn, np, src, dst, map, port)
|
|||
hv += dst->i6[2];
|
||||
hv += dst->i6[1];
|
||||
hv += dst->i6[0];
|
||||
hv %= HOSTMAP_SIZE;
|
||||
hv %= softn->ipf_nat_hostmap_sz;
|
||||
for (hm = softn->ipf_hm_maptable[hv]; hm; hm = hm->hm_next)
|
||||
if (IP6_EQ(&hm->hm_osrc6, src) &&
|
||||
IP6_EQ(&hm->hm_odst6, dst) &&
|
||||
|
|
|
|||
Loading…
Reference in a new issue