X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=extras%2Fvom%2Fvom%2Fnat_binding.cpp;h=3c3d8261d6701fd97af2a80cd9b5ed803932086e;hb=7c03ed4;hp=64b7a1007ac94b6a76bb593d67a3defb0c274b0f;hpb=164e5f8c63652028ecb9c3570e1ea8618b163071;p=vpp.git diff --git a/extras/vom/vom/nat_binding.cpp b/extras/vom/vom/nat_binding.cpp index 64b7a1007ac..3c3d8261d67 100644 --- a/extras/vom/vom/nat_binding.cpp +++ b/extras/vom/vom/nat_binding.cpp @@ -222,9 +222,15 @@ nat_binding::event_handler::handle_populate(const client_db::key_t& key) auto& payload = record.get_payload(); std::shared_ptr itf = interface::find(payload.sw_if_index); - nat_binding nb(*itf, direction_t::INPUT, l3_proto_t::IPV4, - zone_t::from_vpp(payload.is_inside)); - OM::commit(key, nb); + + if (itf) { + nat_binding nb(*itf, direction_t::INPUT, l3_proto_t::IPV4, + zone_t::from_vpp(payload.is_inside)); + OM::commit(key, nb); + } else { + VOM_LOG(log_level_t::ERROR) << "nat-binding-input-44 no sw_if_index: " + << payload.sw_if_index; + } } std::shared_ptr ocmd = @@ -237,9 +243,14 @@ nat_binding::event_handler::handle_populate(const client_db::key_t& key) auto& payload = record.get_payload(); std::shared_ptr itf = interface::find(payload.sw_if_index); - nat_binding nb(*itf, direction_t::OUTPUT, l3_proto_t::IPV4, - zone_t::from_vpp(payload.is_inside)); - OM::commit(key, nb); + if (itf) { + nat_binding nb(*itf, direction_t::OUTPUT, l3_proto_t::IPV4, + zone_t::from_vpp(payload.is_inside)); + OM::commit(key, nb); + } else { + VOM_LOG(log_level_t::ERROR) << "nat-binding-output-44 no sw_if_index: " + << payload.sw_if_index; + } } std::shared_ptr i6cmd = @@ -252,9 +263,14 @@ nat_binding::event_handler::handle_populate(const client_db::key_t& key) auto& payload = record.get_payload(); std::shared_ptr itf = interface::find(payload.sw_if_index); - nat_binding nb(*itf, direction_t::INPUT, l3_proto_t::IPV6, - zone_t::from_vpp(payload.is_inside)); - OM::commit(key, nb); + if (itf) { + nat_binding nb(*itf, direction_t::INPUT, l3_proto_t::IPV6, + zone_t::from_vpp(payload.is_inside)); + OM::commit(key, nb); + } else { + VOM_LOG(log_level_t::ERROR) << "nat-binding-input-66 no sw_if_index: " + << payload.sw_if_index; + } } }