git: e7a431c229ea - stable/11 - MFC 344f1083e128d8d41ca31853dac513ca3efd9d1f:
Cy Schubert
cy at FreeBSD.org
Tue Feb 16 00:47:27 UTC 2021
The branch stable/11 has been updated by cy:
URL: https://cgit.FreeBSD.org/src/commit/?id=e7a431c229eafe52240f4a62e6d87a4b8187c351
commit e7a431c229eafe52240f4a62e6d87a4b8187c351
Author: Cy Schubert <cy at FreeBSD.org>
AuthorDate: 2021-02-05 14:26:04 +0000
Commit: Cy Schubert <cy at FreeBSD.org>
CommitDate: 2021-02-16 00:40:49 +0000
MFC 344f1083e128d8d41ca31853dac513ca3efd9d1f:
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 344f1083e128d8d41ca31853dac513ca3efd9d1f)
---
sys/contrib/ipfilter/netinet/ip_nat6.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/contrib/ipfilter/netinet/ip_nat6.c b/sys/contrib/ipfilter/netinet/ip_nat6.c
index b2713aec812a..13fa6fb6bc30 100644
--- a/sys/contrib/ipfilter/netinet/ip_nat6.c
+++ b/sys/contrib/ipfilter/netinet/ip_nat6.c
@@ -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) &&
More information about the dev-commits-src-all
mailing list