Blame SOURCES/0005-igmp-trusted-query.patch

23b54f
From ff4516227cc48b3175106a419f43b8fc9eee3710 Mon Sep 17 00:00:00 2001
23b54f
From: Donald Sharp <sharpd@cumulusnetworks.com>
23b54f
Date: Tue, 25 Jun 2019 00:30:11 -0400
23b54f
Subject: [PATCH] pimd: Dissallow query to be received from a non-connected
23b54f
 source
23b54f
23b54f
When we receive an igmp query on a interface, ensure that the
23b54f
source address of the packet is connected to the incoming
23b54f
interface.  This will prevent a meanie from crafting a igmp
23b54f
packet with a source address less than ours and causing
23b54f
us to suspend query activities.
23b54f
23b54f
Fixes: #1692
23b54f
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
23b54f
---
23b54f
 pimd/pim_igmp.c | 7 +++++++
23b54f
 1 file changed, 7 insertions(+)
23b54f
23b54f
diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c
23b54f
index 270f1e3f27..5beabbd8df 100644
23b54f
--- a/pimd/pim_igmp.c
23b54f
+++ b/pimd/pim_igmp.c
23b54f
@@ -305,6 +305,13 @@ static int igmp_recv_query(struct igmp_sock *igmp, int query_version,
23b54f
 		return -1;
23b54f
 	}
23b54f
 
23b54f
+	if (!pim_if_connected_to_source(ifp, from)) {
23b54f
+		if (PIM_DEBUG_IGMP_PACKETS)
23b54f
+			zlog_debug("Recv IGMP query on interface: %s from a non-connected source: %s",
23b54f
+				   ifp->name, from_str);
23b54f
+		return 0;
23b54f
+	}
23b54f
+
23b54f
 	/* Collecting IGMP Rx stats */
23b54f
 	switch (query_version) {
23b54f
 	case 1: