summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-10-04 08:36:56 -0700
committerDave Barach <openvpp@barachs.net>2018-10-04 17:50:59 +0000
commit3e42ebe6ab460ba3eb0a6e334c084c9a669fbc4f (patch)
treec13869d45c47f7067a693cc87f43b261e1380ded
parent2329e090fc4c158988d4f14b1edb6a8623149679 (diff)
MFIB-API: when programming an (S,G) fix the grp-len
Change-Id: I97052d29080501de53fe95499c860faf0765e81d Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
-rw-r--r--src/vnet/ip/ip_api.c4
-rw-r--r--test/test_ip_mcast.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/vnet/ip/ip_api.c b/src/vnet/ip/ip_api.c
index b0a7e82949b..91832a07e09 100644
--- a/src/vnet/ip/ip_api.c
+++ b/src/vnet/ip/ip_api.c
@@ -1298,6 +1298,8 @@ api_mroute_add_del_t_handler (vl_api_ip_mroute_add_del_t * mp,
sizeof (pfx.fp_src_addr.ip4));
memset (&nh.ip6, 0, sizeof (nh.ip6));
clib_memcpy (&nh.ip4, mp->nh_address, sizeof (nh.ip4));
+ if (!ip46_address_is_zero (&pfx.fp_src_addr))
+ pfx.fp_len = 64;
}
else
{
@@ -1306,6 +1308,8 @@ api_mroute_add_del_t_handler (vl_api_ip_mroute_add_del_t * mp,
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));
+ if (!ip46_address_is_zero (&pfx.fp_src_addr))
+ pfx.fp_len = 256;
}
mfib_entry_index = mroute_add_del_handler (mp->is_add,
diff --git a/test/test_ip_mcast.py b/test/test_ip_mcast.py
index 1a39e9a9d81..cca4f802089 100644
--- a/test/test_ip_mcast.py
+++ b/test/test_ip_mcast.py
@@ -217,7 +217,7 @@ class TestIPMcast(VppTestCase):
route_1_1_1_1_232_1_1_1 = VppIpMRoute(
self,
"1.1.1.1",
- "232.1.1.1", 64,
+ "232.1.1.1", 27, # any grp-len is ok when src is set
MRouteEntryFlags.MFIB_ENTRY_FLAG_NONE,
[VppMRoutePath(self.pg0.sw_if_index,
MRouteItfFlags.MFIB_ITF_FLAG_ACCEPT),
@@ -425,7 +425,7 @@ class TestIPMcast(VppTestCase):
route_2001_ff01_1 = VppIpMRoute(
self,
"2001::1",
- "ff01::1", 256,
+ "ff01::1", 0, # any grp-len is ok when src is set
MRouteEntryFlags.MFIB_ENTRY_FLAG_NONE,
[VppMRoutePath(self.pg0.sw_if_index,
MRouteItfFlags.MFIB_ITF_FLAG_ACCEPT,