summaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-03-01 07:16:40 -0800
committerNeale Ranns <nranns@cisco.com>2019-03-01 07:16:40 -0800
commitbbe2de1fbf06da4f420c292d3e7c73f9b588c53e (patch)
tree74ebdffccaba0649121964678d6fb84251c3ed3a /extras
parent2b81e3cba77e6427b47228318d55e40a859d02d1 (diff)
VOM: mprefix and mpath encode fixes
Change-Id: Id3c281e680683c7267c9db66cc806fed58c8cfcb Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'extras')
-rw-r--r--extras/vom/vom/mroute_cmds.cpp2
-rw-r--r--extras/vom/vom/route.cpp8
-rw-r--r--extras/vom/vom/route.hpp2
-rw-r--r--extras/vom/vom/route_api_types.cpp4
4 files changed, 10 insertions, 6 deletions
diff --git a/extras/vom/vom/mroute_cmds.cpp b/extras/vom/vom/mroute_cmds.cpp
index e4df00a6ddd..232d786abeb 100644
--- a/extras/vom/vom/mroute_cmds.cpp
+++ b/extras/vom/vom/mroute_cmds.cpp
@@ -52,7 +52,7 @@ update_cmd::issue(connection& con)
payload.table_id = m_id;
payload.is_add = 1;
- m_mprefix.to_vpp(&payload.is_ipv6, payload.grp_address, payload.src_address,
+ m_mprefix.to_vpp(&payload.is_ipv6, payload.src_address, payload.grp_address,
&payload.grp_address_length);
to_vpp(m_path, payload);
diff --git a/extras/vom/vom/route.cpp b/extras/vom/vom/route.cpp
index d4d794fbd19..b136c251b94 100644
--- a/extras/vom/vom/route.cpp
+++ b/extras/vom/vom/route.cpp
@@ -47,8 +47,8 @@ path::flags_t::flags_t(int v, const std::string& s)
}
const itf_flags_t itf_flags_t::NONE(0, "none");
-const itf_flags_t itf_flags_t::ACCEPT((1 << 2), "accept");
-const itf_flags_t itf_flags_t::FORWARD((1 << 3), "forward");
+const itf_flags_t itf_flags_t::ACCEPT((1 << 1), "accept");
+const itf_flags_t itf_flags_t::FORWARD((1 << 2), "forward");
itf_flags_t::itf_flags_t(int v, const std::string& s)
: enum_base<itf_flags_t>(v, s)
@@ -63,9 +63,9 @@ itf_flags_t::from_vpp(uint32_t val)
return itf_flags_t::FORWARD;
}
-path::path(special_t special)
+path::path(special_t special, const nh_proto_t& proto)
: m_type(special)
- , m_nh_proto(nh_proto_t::IPV4)
+ , m_nh_proto(proto)
, m_flags(flags_t::NONE)
, m_nh()
, m_rd(nullptr)
diff --git a/extras/vom/vom/route.hpp b/extras/vom/vom/route.hpp
index a09f704f60c..746ceb29ebc 100644
--- a/extras/vom/vom/route.hpp
+++ b/extras/vom/vom/route.hpp
@@ -97,7 +97,7 @@ public:
/**
* constructor for special paths
*/
- path(special_t special);
+ path(special_t special, const nh_proto_t& proto = nh_proto_t::IPV4);
/**
* Constructor for standard non-recursive paths
diff --git a/extras/vom/vom/route_api_types.cpp b/extras/vom/vom/route_api_types.cpp
index 85fca05b35a..b12cd60c4d0 100644
--- a/extras/vom/vom/route_api_types.cpp
+++ b/extras/vom/vom/route_api_types.cpp
@@ -62,6 +62,8 @@ to_vpp(const route::path& p, vapi_payload_ip_add_del_route& payload)
void
to_vpp(const route::path& p, vapi_payload_ip_mroute_add_del& payload)
{
+ payload.next_hop_afi = p.nh_proto();
+
if (route::path::special_t::STANDARD == p.type()) {
uint8_t path_v6;
to_bytes(p.nh(), &path_v6, payload.nh_address);
@@ -71,6 +73,8 @@ to_vpp(const route::path& p, vapi_payload_ip_mroute_add_del& payload)
}
payload.next_hop_afi = p.nh_proto();
+ } else if (route::path::special_t::LOCAL == p.type()) {
+ payload.is_local = 1;
}
}