From: Andrew Lunn <andrew@lunn.ch>
To: Ujjal Roy <royujjal@gmail.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
Linux Stable <stable@vger.kernel.org>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Nikolay Aleksandrov <razor@blackwall.org>,
Ido Schimmel <idosch@nvidia.com>,
David Ahern <dsahern@kernel.org>, Shuah Khan <shuah@kernel.org>,
Andy Roulin <aroulin@nvidia.com>, Yong Wang <yongwang@nvidia.com>,
Petr Machata <petrm@nvidia.com>, Ujjal Roy <ujjal@alumnux.com>,
bridge@lists.linux.dev, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: Please backport bridge multicast exponential field encoding fix series to 6.1.y/6.6.y/6.12.y/6.18.y/7.0.y
Date: Thu, 9 Jul 2026 22:01:18 +0200 [thread overview]
Message-ID: <14350a31-ffc7-41fd-84d3-6cfb2cb96841@lunn.ch> (raw)
In-Reply-To: <CAE2MWkn3L7V3x8i0F-soGLxsBBo_Umgs1pJ3FwCw1OW7=U55zg@mail.gmail.com>
> > > History: The multicast stack currently supports decoding of IGMPv3 and
> > > MLDv2 exponential timer field encodings, but lacks the corresponding
> > > encoding logic when generating multicast query packets.
RFC 3376 says:
4.1.1. Max Resp Code
The Max Resp Code field specifies the maximum time allowed before
sending a responding report. The actual time allowed, called the Max
Resp Time, is represented in units of 1/10 second and is derived from
the Max Resp Code as follows:
If Max Resp Code < 128, Max Resp Time = Max Resp Code
If Max Resp Code >= 128, Max Resp Code represents a floating-point
value as follows:
0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+
|1| exp | mant |
+-+-+-+-+-+-+-+-+
Max Resp Time = (mant | 0x10) << (exp + 3)
Small values of Max Resp Time allow IGMPv3 routers to tune the "leave
latency" (the time between the moment the last host leaves a group
and the moment the routing protocol is notified that there are no
more members). Larger values, especially in the exponential range,
allow tuning of the burstiness of IGMP traffic on a network.
Let me check i understand the issue. If the user configures a value >
127, linux continues to use the linear encoding, but a peer decodes it
as a floating value.
128 linear is 0 | 0x10) << (0 + 3) = 0x40 = 64. So the peer sends the
reports earlier than required?
255 linear is (0xf | 0x10) << (7 + 3) = 0x1F0000 = 2031616. So the
peer can send the reports much later than the 255 1/10 of a second
than userspace expected.
What is useful here is, 'maximum time allowed'. The RFC does not
appear to say how to pick a value between 0 and the maximum time
allowed. Which gives us some flexibility.
I think a much simpler fix for stable is to clamp the user space
request for setting the max response time to 127. That seems like a
one line patch.
Andrew
next prev parent reply other threads:[~2026-07-09 20:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 10:13 Please backport bridge multicast exponential field encoding fix series to 6.1.y/6.6.y/6.12.y/6.18.y/7.0.y Ujjal Roy
2026-07-09 11:04 ` Greg KH
2026-07-09 12:42 ` Ujjal Roy
2026-07-09 12:53 ` Greg KH
2026-07-09 13:05 ` Ujjal Roy
2026-07-09 14:22 ` Greg KH
2026-07-09 15:13 ` Ujjal Roy
2026-07-09 15:21 ` Ujjal Roy
2026-07-09 20:01 ` Andrew Lunn [this message]
2026-07-10 9:10 ` Ujjal Roy
2026-07-10 13:21 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14350a31-ffc7-41fd-84d3-6cfb2cb96841@lunn.ch \
--to=andrew@lunn.ch \
--cc=aroulin@nvidia.com \
--cc=bridge@lists.linux.dev \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=razor@blackwall.org \
--cc=royujjal@gmail.com \
--cc=shuah@kernel.org \
--cc=stable@vger.kernel.org \
--cc=ujjal@alumnux.com \
--cc=yongwang@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox