From 0553380a5375f9e47b7b881dfa9e8c06de3602c9 Mon Sep 17 00:00:00 2001 From: Fedor Date: Sat, 16 Oct 2010 04:13:52 -0400 Subject: [PATCH] ipv4: correct IGMP behavior on v3 query during v2-compatibility mode (backport from 2.6) Backported from kernel.org commit 5b7c84066733c5dfb0e4016d939757b38de189e4 (local RT-N commit f1defb1edf045ddcad9f1e488cb17d17a65cbcec) --- release/src/linux/linux/net/ipv4/igmp.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/release/src/linux/linux/net/ipv4/igmp.c b/release/src/linux/linux/net/ipv4/igmp.c index 671c1156ec..6addb423eb 100644 --- a/release/src/linux/linux/net/ipv4/igmp.c +++ b/release/src/linux/linux/net/ipv4/igmp.c @@ -772,7 +772,7 @@ static void igmp_heard_query(struct in_device *in_dev, struct igmphdr *ih, int mark = 0; - if (len == 8 || IGMP_V2_SEEN(in_dev)) { + if (len == 8) { if (ih->code == 0) { /* Alas, old v1 router presents here. */ @@ -794,6 +794,18 @@ static void igmp_heard_query(struct in_device *in_dev, struct igmphdr *ih, igmpv3_clear_delrec(in_dev); } else if (len < 12) { return; /* ignore bogus packet; freed by caller */ + } else if (IGMP_V1_SEEN(in_dev)) { + /* This is a v3 query with v1 queriers present */ + max_delay = IGMP_Query_Response_Interval; + group = 0; + } else if (IGMP_V2_SEEN(in_dev)) { + /* this is a v3 query with v2 queriers present; + * Interpretation of the max_delay code is problematic here. + * A real v2 host would use ih_code directly, while v3 has a + * different encoding. We use the v3 encoding as more likely + * to be intended in a v3 query. + */ + max_delay = IGMPV3_MRC(ih3->code)*(HZ/IGMP_TIMER_SCALE); } else { /* v3 */ max_delay = IGMPV3_MRC(ih3->code)*(HZ/IGMP_TIMER_SCALE); if (!max_delay) -- 2.11.4.GIT