Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/ipf/netinet From Cy Schubert:



details:   https://anonhg.NetBSD.org/src/rev/32f0f78a9b6c
branches:  trunk
changeset: 959366:32f0f78a9b6c
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Feb 10 00:28:55 2021 +0000

description:
>From Cy Schubert:

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.

diffstat:

 sys/external/bsd/ipf/netinet/ip_nat6.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r b21832834ac1 -r 32f0f78a9b6c sys/external/bsd/ipf/netinet/ip_nat6.c
--- a/sys/external/bsd/ipf/netinet/ip_nat6.c    Tue Feb 09 20:42:31 2021 +0000
+++ b/sys/external/bsd/ipf/netinet/ip_nat6.c    Wed Feb 10 00:28:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_nat6.c,v 1.11 2018/05/03 07:13:48 maxv Exp $        */
+/*     $NetBSD: ip_nat6.c,v 1.12 2021/02/10 00:28:55 christos Exp $    */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -382,7 +382,7 @@
        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) &&



Home | Main Index | Thread Index | Old Index