summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip_api.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-06-01 07:45:05 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2018-04-17 22:29:46 +0000
commite821ab100aea2fb3f740a98650eb750ff5911c49 (patch)
treee679732692ca211858ca64a3125a1e2a82104a7c /src/vnet/ip/ip_api.c
parent167d458cba92e2f64f48fa7bc4430c770f290561 (diff)
IP mcast: allow unicast address as a next-hop
Change-Id: I5e679f2601e37688f2768620479dc2efb7d19ca3 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip_api.c')
-rw-r--r--src/vnet/ip/ip_api.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vnet/ip/ip_api.c b/src/vnet/ip/ip_api.c
index 69ff719f3b9..b4d942b6bef 100644
--- a/src/vnet/ip/ip_api.c
+++ b/src/vnet/ip/ip_api.c
@@ -1208,13 +1208,15 @@ mroute_add_del_handler (u8 is_add,
dpo_proto_t nh_proto,
u32 entry_flags,
fib_rpf_id_t rpf_id,
- u32 next_hop_sw_if_index, u32 itf_flags, u32 bier_imp)
+ u32 next_hop_sw_if_index,
+ ip46_address_t * nh, u32 itf_flags, u32 bier_imp)
{
stats_dslock_with_hint (1 /* release hint */ , 2 /* tag */ );
fib_route_path_t path = {
.frp_sw_if_index = next_hop_sw_if_index,
.frp_proto = nh_proto,
+ .frp_addr = *nh,
};
if (is_local)
@@ -1253,6 +1255,7 @@ api_mroute_add_del_t_handler (vl_api_ip_mroute_add_del_t * mp)
{
fib_protocol_t fproto;
dpo_proto_t nh_proto;
+ ip46_address_t nh;
u32 fib_index;
int rv;
@@ -1277,6 +1280,8 @@ api_mroute_add_del_t_handler (vl_api_ip_mroute_add_del_t * mp)
sizeof (pfx.fp_grp_addr.ip4));
clib_memcpy (&pfx.fp_src_addr.ip4, mp->src_address,
sizeof (pfx.fp_src_addr.ip4));
+ memset (&nh.ip6, 0, sizeof (nh.ip6));
+ clib_memcpy (&nh.ip4, mp->nh_address, sizeof (nh.ip4));
}
else
{
@@ -1284,6 +1289,7 @@ api_mroute_add_del_t_handler (vl_api_ip_mroute_add_del_t * mp)
sizeof (pfx.fp_grp_addr.ip6));
clib_memcpy (&pfx.fp_src_addr.ip6, mp->src_address,
sizeof (pfx.fp_src_addr.ip6));
+ clib_memcpy (&nh.ip6, mp->nh_address, sizeof (nh.ip6));
}
return (mroute_add_del_handler (mp->is_add,
@@ -1293,6 +1299,7 @@ api_mroute_add_del_t_handler (vl_api_ip_mroute_add_del_t * mp)
ntohl (mp->entry_flags),
ntohl (mp->rpf_id),
ntohl (mp->next_hop_sw_if_index),
+ &nh,
ntohl (mp->itf_flags),
ntohl (mp->bier_imp)));
}