X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fnat%2Fnat44-ed%2Fnat44_ed_api.c;h=c0af5e99e8f048e79ec84c31440d377919c404cb;hb=5ae454312c2ffccf47e4b8c430c81f1a3d067e67;hp=36f96827d241f411dd5783c53c0ed70f8557f68b;hpb=c06d660aba34fc9c309af3204fe2cf2fa6619134;p=vpp.git diff --git a/src/plugins/nat/nat44-ed/nat44_ed_api.c b/src/plugins/nat/nat44-ed/nat44_ed_api.c index 36f96827d24..c0af5e99e8f 100644 --- a/src/plugins/nat/nat44-ed/nat44_ed_api.c +++ b/src/plugins/nat/nat44-ed/nat44_ed_api.c @@ -303,9 +303,13 @@ static void for (i = 0; i < count; i++) { if (is_add) - rv = snat_add_address (sm, &this_addr, vrf_id, twice_nat); + { + rv = nat44_ed_add_address (&this_addr, vrf_id, twice_nat); + } else - rv = snat_del_address (sm, this_addr, 0, twice_nat); + { + rv = nat44_ed_del_address (this_addr, 0, twice_nat); + } if (rv) goto send_reply; @@ -890,15 +894,15 @@ static void return; pool_foreach (m, sm->static_mappings) - { - if (is_sm_identity_nat (m->flags) && !is_sm_lb (m->flags)) - { - pool_foreach_index (j, m->locals) - { - send_nat44_identity_mapping_details (m, j, reg, mp->context); - } - } - } + { + if (is_sm_identity_nat (m->flags) && !is_sm_lb (m->flags)) + { + pool_foreach_index (j, m->locals) + { + send_nat44_identity_mapping_details (m, j, reg, mp->context); + } + } + } for (j = 0; j < vec_len (sm->to_resolve); j++) { @@ -915,8 +919,8 @@ static void snat_main_t *sm = &snat_main; vl_api_nat44_add_del_interface_addr_reply_t *rmp; u32 sw_if_index = ntohl (mp->sw_if_index); + u8 twice_nat; int rv = 0; - u8 is_del; if (sm->static_mapping_only) { @@ -924,12 +928,18 @@ static void goto send_reply; } - is_del = !mp->is_add; - VALIDATE_SW_IF_INDEX (mp); - rv = snat_add_interface_address (sm, sw_if_index, is_del, - mp->flags & NAT_API_IS_TWICE_NAT); + twice_nat = mp->flags & NAT_API_IS_TWICE_NAT; + + if (mp->is_add) + { + rv = nat44_ed_add_interface_address (sw_if_index, twice_nat); + } + else + { + rv = nat44_ed_del_interface_address (sw_if_index, twice_nat); + } BAD_SW_IF_INDEX_LABEL;