Re: [PATCH net-next v5 3/5] ipv4: igmp: encode multicast exponential fields
Nikolay Aleksandrov <[email protected]> Sat, 2 May 2026 09:04:48 +0300
| Newsgroups | dev.linux.lists.bridge,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest,org.kernel.vger.netdev |
|---|---|
| Message-ID | <[email protected]> |
On 01/05/2026 20:31, Ujjal Roy wrote: > In IGMP, MRC and QQIC fields are not correctly encoded > when generating query packets. Since the receiver of the > query interprets these fields using the IGMPv3 floating- > point decoding logic, any value that exceeds the linear > threshold is incorrectly parsed as an exponential value, > leading to an incorrect interval calculation. > > Encode and assign the corresponding protocol fields during > query generation. Introduce the logic to dynamically > calculate the exponent and mantissa using bit-scan (fls). > This ensures MRC and QQIC fields (8-bit) are properly > encoded when transmitting query packets with intervals > that exceed their respective linear threshold value of > 128 (for MRT/QQI). > > RFC3376: for both MRC and QQIC, values >= 128 represent > the same floating-point encoding as follows: > 0 1 2 3 4 5 6 7 > +-+-+-+-+-+-+-+-+ > |1| exp | mant | > +-+-+-+-+-+-+-+-+ > > Reviewed-by: Ido Schimmel <[email protected]> > Signed-off-by: Ujjal Roy <[email protected]> > --- > include/linux/igmp.h | 87 +++++++++++++++++++++++++++++++++++++++ > net/bridge/br_multicast.c | 14 +++---- > 2 files changed, 93 insertions(+), 8 deletions(-) > Reviewed-by: Nikolay Aleksandrov <[email protected]>