summaryrefslogtreecommitdiff
path: root/pimd/pim_igmpv3.c
diff options
context:
space:
mode:
Diffstat (limited to 'pimd/pim_igmpv3.c')
-rw-r--r--pimd/pim_igmpv3.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/pimd/pim_igmpv3.c b/pimd/pim_igmpv3.c
index 6ba48d6488..6ed5c501b2 100644
--- a/pimd/pim_igmpv3.c
+++ b/pimd/pim_igmpv3.c
@@ -1890,6 +1890,7 @@ int igmp_v3_recv_report(struct gm_sock *igmp, struct in_addr from,
uint8_t *group_record;
uint8_t *report_pastend = (uint8_t *)igmp_msg + igmp_msg_len;
struct interface *ifp = igmp->interface;
+ struct pim_interface *pim_ifp = ifp->info;
int i;
if (igmp->mtrace_only)
@@ -1913,6 +1914,13 @@ int igmp_v3_recv_report(struct gm_sock *igmp, struct in_addr from,
/* Collecting IGMP Rx stats */
igmp->igmp_stats.report_v3++;
+ if (pim_ifp->igmp_version == 2) {
+ zlog_warn(
+ "Received Version 3 packet but interface: %s is configured for version 2",
+ ifp->name);
+ return -1;
+ }
+
num_groups = ntohs(
*(uint16_t *)(igmp_msg + IGMP_V3_REPORT_NUMGROUPS_OFFSET));
if (num_groups < 1) {