]> git.hungrycats.org Git - linux/commit
ipv4: igmp: encode multicast exponential fields
authorUjjal Roy <royujjal@gmail.com>
Sat, 2 May 2026 13:19:04 +0000 (13:19 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 5 May 2026 02:09:41 +0000 (19:09 -0700)
commit95bfd196f0dc6ccf8ef02356cf7088778b84416b
tree0cc9a4256ab476d611ab990a7fbf0b3356207c23
parent12cfb4ecc471652890cae362b8609d9f71b46ee9
ipv4: igmp: encode multicast exponential fields

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: Nikolay Aleksandrov <razor@blackwall.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Ujjal Roy <royujjal@gmail.com>
Link: https://patch.msgid.link/20260502131907.987-4-royujjal@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/igmp.h
net/bridge/br_multicast.c