From 27775f0b903f4ea088514153e27354d5094cbf0c Mon Sep 17 00:00:00 2001 From: Filip Varga Date: Fri, 17 Sep 2021 14:11:59 +0200 Subject: nat: NAT44-ED api fix and improvement This patch fixes issue with NAT_API_IS_TWICE_NAT and NAT_API_IS_ADDR_ONLY flags. Because of control plane code change - move from boolean parameters to flags in https://gerrit.fd.io/r/c/vpp/+/32796 patch these api flags weren't correctly set. Type: fix Change-Id: Ieec5fe6bdcca314da027f2d23e3a24f174391a6f Signed-off-by: Filip Varga --- src/plugins/nat/nat44-ed/nat44_ed.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/plugins/nat/nat44-ed/nat44_ed.c') diff --git a/src/plugins/nat/nat44-ed/nat44_ed.c b/src/plugins/nat/nat44-ed/nat44_ed.c index b1917f3b36c..f58002c156d 100644 --- a/src/plugins/nat/nat44-ed/nat44_ed.c +++ b/src/plugins/nat/nat44-ed/nat44_ed.c @@ -3068,7 +3068,7 @@ nat44_ed_add_del_static_mapping_addr_only_cb ( for (i = 0; i < vec_len (sm->to_resolve); i++) { rp = sm->to_resolve + i; - if (rp->addr_only && rp->sw_if_index == sw_if_index) + if (is_sm_addr_only (rp->flags) && rp->sw_if_index == sw_if_index) { match = 1; break; @@ -3079,8 +3079,8 @@ nat44_ed_add_del_static_mapping_addr_only_cb ( return; } - m = nat44_ed_sm_o2i_lookup (sm, *address, rp->addr_only ? 0 : rp->e_port, 0, - rp->proto); + m = nat44_ed_sm_o2i_lookup ( + sm, *address, is_sm_addr_only (rp->flags) ? 0 : rp->e_port, 0, rp->proto); if (is_delete) { @@ -3171,7 +3171,7 @@ nat44_ed_add_del_interface_address_cb (ip4_main_t *im, uword opaque, for (i = 0; i < vec_len (sm->to_resolve); i++) { rp = sm->to_resolve + i; - if (rp->addr_only) + if (is_sm_addr_only (rp->flags)) { continue; } -- cgit 1.2.3-korg