From nobody Wed Aug 30 09:14:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RbJXD6TNMz4rvTZ; Wed, 30 Aug 2023 09:14:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RbJXD5wfWz3Q6F; Wed, 30 Aug 2023 09:14:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693386876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iJ77BKZIdTlnPdaVQ2vhsMZ+zR37Dka6CVl3fn1wE4I=; b=Pw46f9d920aShoCN8lVCmJHZWgQhs7y+fDhiRHfYM4uQk09rn7R8HiCugz/h75MSCUagrz TQkV7NbC5ZpE3iHi7NUl4aIo87myeqU66P2UnCQOYp1KCq/1V0lwiDJVYrkEhC005PblBC eVtcaqhgx/XBpLqiVVMTRadZGAC0wPp2tecJbzdeiyyD9w7J+Eu1PcQsQmUiJmQdOcf35g l1M7afAINeArhyChX930GwLWJ+tku+xl0NOQ21/3mGPpeY0aRv73oJr2wmXy26/VyRMMWf SMeBXvGDJAYw/YHYNkwdC1bGdA8pvdx/+yE10NxRW2J3mJ+zbO4vqPESBlSo0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693386876; a=rsa-sha256; cv=none; b=mOXyTYdIN8wNA2/YPwE3dxXaEPvDfn/+jE3VsmoQz4hLYUENTDiqDXqOdZePf0p1lz24xB jAwxiJtIb5ssca5Dx9JZ9GhywKcT7AfafMacfAEguhD4rjvoX75Zl8KIEfTqZakW7wo9yE oc2YCUq0xIzKSex4SCmmH9VeJlxRmiK+ueGOLRbWalsYm1niOQjB+CcMzL8X8o5qUTrbwK 20QIGPFeNRGskG+nBUowRBSv/bEsVsS+BDc/2DRgkhJANq4oqbgKn+UbbjvpWczzqwieRu KY3xejxVcN8GFF9rSELOfstmG9T8HIingYsnQh+HneB+zN9jb0j9vQkxu/vd2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693386876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iJ77BKZIdTlnPdaVQ2vhsMZ+zR37Dka6CVl3fn1wE4I=; b=Y1r0krnLBbdzu9/BJo4VvbCMo9uH2cs/AK44kFau9SI1G1prRBGJfNgcU5fcChGrC3J5v0 oKfN2G/0Dy2k7ayBu12b5lsZ/IxDUO/BRysFAqzNF4ONf4tE4wmgULrhTao8AkkFyIGeU9 osytCthueqt9U4VahNmy8HxVqJB2oXTkqgKzSeaZGEvKHQI+rO3rLV8RrCceqD+f+qeXZy KNCAS5GibjO4Pa8qGiQj6/57cU76ImtjkqgyumJaQe5DSrTIluSOB9CiY+Ei9qn29It9C0 dWQuZZ39nvXqQi/oo3Jw/acRpLFWNI/h+uUZcHMsOTzQcAt2+woisXr5yW6ryQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RbJXD4g3vzDD9; Wed, 30 Aug 2023 09:14:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37U9Earu031563; Wed, 30 Aug 2023 09:14:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37U9Ea7E031560; Wed, 30 Aug 2023 09:14:36 GMT (envelope-from git) Date: Wed, 30 Aug 2023 09:14:36 GMT Message-Id: <202308300914.37U9Ea7E031560@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: b94ec00ba73e - main - igmp: do not upgrade IGMP version beyond net.inet.igmp.default_version List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b94ec00ba73ef4769f62555bfcb840919143e198 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b94ec00ba73ef4769f62555bfcb840919143e198 commit b94ec00ba73ef4769f62555bfcb840919143e198 Author: Kristof Provost AuthorDate: 2023-08-29 09:23:49 +0000 Commit: Kristof Provost 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,