summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Roys <roysjosh@gmail.com>2021-10-12 09:25:47 -0400
committerJoshua Roys <roysjosh@gmail.com>2021-10-25 19:53:58 +0000
commit9298a7ec0c23ea95bd8ff6e91fc74e6ecbd53785 (patch)
treefbf98c5fa801796ca1019ea0d642f06315d3fc24
parentc1931b2f0932d29f3ea73452b497a3d05eca9352 (diff)
nat: fix static mapping segv
Adding a nat44 static mapping during startup on a DHCP interface leads to a segv via this path: - dhcp_client_acquire_address - ip4_add_del_interface_address - ip4_add_del_interface_address_internal - nat44_ed_add_del_interface_address_cb - nat44_ed_add_static_mapping - ip4_interface_first_address Type: fix Signed-off-by: Joshua Roys <roysjosh@gmail.com> Change-Id: I38dac8a096b052550f2b87b4e13a950d2cd868b0 (cherry picked from commit f9074fc51544d1849a2df06713c1ccf6cb2eb908)
-rw-r--r--src/plugins/nat/nat44-ed/nat44_ed.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/nat/nat44-ed/nat44_ed.c b/src/plugins/nat/nat44-ed/nat44_ed.c
index a11043682b9..e949df20b45 100644
--- a/src/plugins/nat/nat44-ed/nat44_ed.c
+++ b/src/plugins/nat/nat44-ed/nat44_ed.c
@@ -3342,7 +3342,7 @@ nat44_ed_add_del_interface_address_cb (ip4_main_t *im, uword opaque,
{
rv = nat44_ed_add_static_mapping (
rp->l_addr, address[0], rp->l_port, rp->e_port, rp->proto,
- rp->vrf_id, ~0, rp->flags, rp->pool_addr, rp->tag);
+ rp->vrf_id, sw_if_index, rp->flags, rp->pool_addr, rp->tag);
if (rv)
{
nat_elog_notice_X1 (sm, "add_static_mapping returned %d",