summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vom
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2018-01-12 19:11:44 +0100
committerNeale Ranns <nranns@cisco.com>2018-01-22 22:16:23 +0000
commita370679bd82b3d86ac965e391cc3541973e5682f (patch)
tree109326e85c2a50dc369ebd985e37a1bc19f44570 /src/vpp-api/vom
parent18e955ea8a90b691294d71c0772770c88fadc062 (diff)
vom: ip_route: fix handle populate
Change-Id: I91892084133daadb74caa7aa13ee1071599ba892 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vpp-api/vom')
-rw-r--r--src/vpp-api/vom/route.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/vpp-api/vom/route.cpp b/src/vpp-api/vom/route.cpp
index a0474676ee6..3b86fb28357 100644
--- a/src/vpp-api/vom/route.cpp
+++ b/src/vpp-api/vom/route.cpp
@@ -424,10 +424,15 @@ ip_route::event_handler::handle_populate(const client_db::key_t& key)
path path_v4(path::special_t::PROHIBIT);
ip_r.add(path_v4);
} else {
- std::shared_ptr<interface> itf = interface::find(p.sw_if_index);
boost::asio::ip::address address = from_bytes(0, p.next_hop);
- path path_v4(address, *itf, p.weight, p.preference);
- ip_r.add(path_v4);
+ std::shared_ptr<interface> itf = interface::find(p.sw_if_index);
+ if (itf) {
+ path path_v4(address, *itf, p.weight, p.preference);
+ ip_r.add(path_v4);
+ } else {
+ path path_v4(rd_temp, address, p.weight, p.preference);
+ ip_r.add(path_v4);
+ }
}
}
VOM_LOG(log_level_t::DEBUG) << "ip-route-dump: " << ip_r.to_string();
@@ -468,8 +473,13 @@ ip_route::event_handler::handle_populate(const client_db::key_t& key)
} else {
std::shared_ptr<interface> itf = interface::find(p.sw_if_index);
boost::asio::ip::address address = from_bytes(1, p.next_hop);
- path path_v6(address, *itf, p.weight, p.preference);
- ip_r.add(path_v6);
+ if (itf) {
+ path path_v6(address, *itf, p.weight, p.preference);
+ ip_r.add(path_v6);
+ } else {
+ path path_v6(rd_temp, address, p.weight, p.preference);
+ ip_r.add(path_v6);
+ }
}
}
VOM_LOG(log_level_t::DEBUG) << "ip-route-dump: " << ip_r.to_string();