IGMP: handle (*,G) report with no source addresses
Change-Id: I363370b9d4a27b992bad55c48fc930a2fbea2165 Signed-off-by: Neale Ranns <nranns@cisco.com>
This commit is contained in:
Neale Ranns
committed by
Damjan Marion
parent
bc0c8fe6ff
commit
21064cec96
@ -32,15 +32,21 @@ igmp_group_mk_source_list (const igmp_membership_group_v3_t * r)
|
|||||||
n = clib_net_to_host_u16 (r->n_src_addresses);
|
n = clib_net_to_host_u16 (r->n_src_addresses);
|
||||||
|
|
||||||
if (0 == n)
|
if (0 == n)
|
||||||
return (NULL);
|
|
||||||
|
|
||||||
vec_validate (srcs, n - 1);
|
|
||||||
s = r->src_addresses;
|
|
||||||
|
|
||||||
for (ii = 0; ii < n; ii++)
|
|
||||||
{
|
{
|
||||||
srcs[ii].ip4 = *s;
|
/* a (*,G) join has no source address specified */
|
||||||
s++;
|
vec_validate (srcs, 0);
|
||||||
|
srcs[0].ip4.as_u32 = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vec_validate (srcs, n - 1);
|
||||||
|
s = r->src_addresses;
|
||||||
|
|
||||||
|
for (ii = 0; ii < n; ii++)
|
||||||
|
{
|
||||||
|
srcs[ii].ip4 = *s;
|
||||||
|
s++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (srcs);
|
return (srcs);
|
||||||
|
@ -628,6 +628,22 @@ class TestIgmp(VppTestCase):
|
|||||||
self.assertFalse(self.vapi.igmp_dump())
|
self.assertFalse(self.vapi.igmp_dump())
|
||||||
self.assertFalse(self.vapi.igmp_dump())
|
self.assertFalse(self.vapi.igmp_dump())
|
||||||
|
|
||||||
|
#
|
||||||
|
# A (*,G) host report
|
||||||
|
#
|
||||||
|
p_j = (Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) /
|
||||||
|
IP(src=self.pg0.remote_ip4, dst="224.0.0.22", tos=0xc0, ttl=1,
|
||||||
|
options=[IPOption(copy_flag=1, optclass="control",
|
||||||
|
option="router_alert")]) /
|
||||||
|
IGMPv3(type="Version 3 Membership Report") /
|
||||||
|
IGMPv3mr(numgrp=1) /
|
||||||
|
IGMPv3gr(rtype="Allow New Sources", maddr="239.1.1.2"))
|
||||||
|
|
||||||
|
self.send(self.pg0, p_j)
|
||||||
|
|
||||||
|
self.assertTrue(wait_for_igmp_event(self, 1, self.pg0,
|
||||||
|
"239.1.1.2", "0.0.0.0", 1))
|
||||||
|
|
||||||
#
|
#
|
||||||
# disable router config
|
# disable router config
|
||||||
#
|
#
|
||||||
|
Reference in New Issue
Block a user