Skip to content

net: ip: igmp: IGMPv2 does not work when IGMPv3 is enabled #79788

@IVandeVeire

Description

@IVandeVeire

Describe the bug

The current IGMP implementation does not correctly calculate the length of the IGMP payload. Since the length of the payload is used to detect the IGMP version. The version is also not correctly determined.

The length of the IGMP payload is calculated by subtracting the IP packet header length from to total IP packet length. Since the actual length of the header is the combination of the header length and the option length, the IGMP length is always 4 bytes too long. This results in IGMPv2 messages being parsed as IGMPv3, causing a drop of the packet.

int igmp_buf_len = pkt->buffer->len - net_pkt_ip_hdr_len(pkt);

To Reproduce

Enable CONFIG_NET_IPV4_IGMPV3 and add the device to an IGMPv2 network.

Expected behavior

The device should respond to IGMPv2 queries.

Impact

All IGMPv2 messages are ignored. This results in the multicast only working for the IGMP querier-timeout. After that, the querier does forget the membership of the device.

Environment (please complete the following information):

  • OS: on all OS
  • All branches containing 1d0f47b

Metadata

Metadata

Labels

area: NetworkingbugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions