aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat44-ei
diff options
context:
space:
mode:
authorMatthew Smith <mgsmith@netgate.com>2021-05-13 11:11:33 -0500
committerMatthew Smith <mgsmith@netgate.com>2021-05-25 13:12:01 +0000
commit01930f568a2472a3352ab80ea1d3b4cccf4ae0c7 (patch)
treed3a1fb9738500c84babcf9fc7499731eecb82d9c /src/plugins/nat/nat44-ei
parent06274811e419bedf3179a99bed3331f0c0b951df (diff)
nat: report correct EI per-user session limit
Type: fix When enabling the endpoint independent NAT44 plugin, user_sessions determines the maximum number of translations that can be active for a single inside address. If 0 is passed in, a default value is used but 0 is still stored in the field that is used to populate reply messages to nat44_ei_show_running_config, At the time of enabling the plugin, if user_sessions is 0, update the field which is used by nat44_ei_show_running_config to contain the default per-user limit which gets used by the EI nodes. Change-Id: I6b060d85bcd42d91db879b95a8b07c6844bcd2a5 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Diffstat (limited to 'src/plugins/nat/nat44-ei')
-rw-r--r--src/plugins/nat/nat44-ei/nat44_ei.api2
-rw-r--r--src/plugins/nat/nat44-ei/nat44_ei.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/nat/nat44-ei/nat44_ei.api b/src/plugins/nat/nat44-ei/nat44_ei.api
index 38251b072dd..9ea1a3a1dde 100644
--- a/src/plugins/nat/nat44-ei/nat44_ei.api
+++ b/src/plugins/nat/nat44-ei/nat44_ei.api
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-option version = "1.1.0";
+option version = "1.1.1";
import "vnet/ip/ip_types.api";
import "vnet/interface_types.api";
import "plugins/nat/lib/nat_types.api";
diff --git a/src/plugins/nat/nat44-ei/nat44_ei.c b/src/plugins/nat/nat44-ei/nat44_ei.c
index 77c224d0513..3c9a9a85346 100644
--- a/src/plugins/nat/nat44-ei/nat44_ei.c
+++ b/src/plugins/nat/nat44-ei/nat44_ei.c
@@ -428,6 +428,9 @@ nat44_ei_plugin_enable (nat44_ei_config_t c)
if (!c.sessions)
c.sessions = 10 * 1024;
+ if (!c.user_sessions)
+ c.user_sessions = c.sessions;
+
nm->rconfig = c;
if (!nm->frame_queue_nelts)
@@ -448,8 +451,7 @@ nat44_ei_plugin_enable (nat44_ei_config_t c)
nm->max_users_per_thread = c.users;
nm->max_translations_per_thread = c.sessions;
- nm->max_translations_per_user =
- c.user_sessions ? c.user_sessions : nm->max_translations_per_thread;
+ nm->max_translations_per_user = c.user_sessions;
nm->inside_vrf_id = c.inside_vrf;
nm->inside_fib_index = fib_table_find_or_create_and_lock (