git: b94ec00ba73e - main - igmp: do not upgrade IGMP version beyond net.inet.igmp.default_version
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 30 Aug 2023 09:14:36 UTC
The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b94ec00ba73ef4769f62555bfcb840919143e198 commit b94ec00ba73ef4769f62555bfcb840919143e198 Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2023-08-29 09:23:49 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2023-08-30 07:22:05 +0000 igmp: do not upgrade IGMP version beyond net.inet.igmp.default_version IGMP requires hosts to use the lowest version they've seen on the network. When the IGMP timers expire we take the opportunity to upgrade again. However, we did not take the net.inet.igmp.default_version sysctl setting into account, so we could end up switching to IGMPv3 even if the user had requested IGMPv2 or IGMPv1 via the sysctl. Check V_igmp_default_version before we upgrade the IGMP version. Reviewed by: adrian Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D41628 --- sys/netinet/igmp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index c3dd0302fb39..9ae6d33564f2 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -2124,7 +2124,8 @@ igmp_v1v2_process_querier_timers(struct igmp_ifsoftc *igi) * * Revert to IGMPv3. */ - if (igi->igi_version != IGMP_VERSION_3) { + if (V_igmp_default_version == IGMP_VERSION_3 && + igi->igi_version != IGMP_VERSION_3) { CTR5(KTR_IGMPV3, "%s: transition from v%d -> v%d on %p(%s)", __func__, igi->igi_version, IGMP_VERSION_3, @@ -2139,7 +2140,8 @@ igmp_v1v2_process_querier_timers(struct igmp_ifsoftc *igi) * revert to IGMPv3. * If IGMPv2 is enabled, revert to IGMPv2. */ - if (!V_igmp_v2enable) { + if (V_igmp_default_version == IGMP_VERSION_3 && + !V_igmp_v2enable) { CTR5(KTR_IGMPV3, "%s: transition from v%d -> v%d on %p(%s)", __func__, igi->igi_version, IGMP_VERSION_3, @@ -2148,7 +2150,8 @@ igmp_v1v2_process_querier_timers(struct igmp_ifsoftc *igi) igi->igi_version = IGMP_VERSION_3; } else { --igi->igi_v2_timer; - if (igi->igi_version != IGMP_VERSION_2) { + if (V_igmp_default_version == IGMP_VERSION_2 && + igi->igi_version != IGMP_VERSION_2) { CTR5(KTR_IGMPV3, "%s: transition from v%d -> v%d on %p(%s)", __func__, igi->igi_version, IGMP_VERSION_2, @@ -2166,7 +2169,8 @@ igmp_v1v2_process_querier_timers(struct igmp_ifsoftc *igi) * revert to IGMPv3. * If IGMPv1 is enabled, reset IGMPv2 timer if running. */ - if (!V_igmp_v1enable) { + if (V_igmp_default_version == IGMP_VERSION_3 && + !V_igmp_v1enable) { CTR5(KTR_IGMPV3, "%s: transition from v%d -> v%d on %p(%s)", __func__, igi->igi_version, IGMP_VERSION_3,