Bug 290407 - IPv6 MLD (Multicast Listener Discovery) packets do not contain Router Alert
Summary: IPv6 MLD (Multicast Listener Discovery) packets do not contain Router Alert
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 15.0-CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Mark Johnston
URL:
Keywords:
Depends on:
Blocks: 15.0-metabug
  Show dependency treegraph
 
Reported: 2025-10-21 19:34 UTC by Denny Page
Modified: 2025-11-05 19:47 UTC (History)
4 users (show)

See Also:


Attachments
proposed patch (503 bytes, patch)
2025-10-22 09:01 UTC, Andrey V. Elsukov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Denny Page 2025-10-21 19:34:44 UTC
IPv6 Multicast Listener Discovery packets, specifically Multicast Listener Reports, do not contain a Router Alert option as required by the Multicast Listener Discovery RFCs. The lack of a Router Alert option causes Listener Report packets to be discarded by receivers.

Specifics from the RFCs:

* RFC 2710 (MLDv1) Section 3:

All MLD messages described in this document are sent with a link-local IPv6 Source Address, an IPv6 Hop Limit of 1, and an IPv6 Router Alert option [RTR-ALERT: RFC2711] in a Hop-by-Hop Options header.


* RFC 3810 & RFC 9777 (MLDv2) Section 5:

All MLDv2 messages described in this document MUST be sent with a link-local IPv6 Source Address, an IPv6 Hop Limit of 1, and an IPv6 Router Alert option [RFC2711] in a Hop-by-Hop Options header.


* RFC 3810 & RFC 9777 (MLDv2) Section 7.4:

Upon reception of an MLD message that contains a Report, the router checks if the source address of the message is a valid link-local address, if the Hop Limit is set to 1, and if the Router Alert option is present in the Hop-by-Hop Options header of the IPv6 packet. If any of these checks fail, the packet is dropped.
Comment 1 Andrey V. Elsukov freebsd_committer freebsd_triage 2025-10-22 09:01:40 UTC
Created attachment 264780 [details]
proposed patch

It seems it was broken after 530c2c30b0c75f1a71df637ae1e09b352f8256cb.
Can you test the attached patch?
Comment 2 Zhenlei Huang freebsd_committer freebsd_triage 2025-10-22 11:01:00 UTC
(In reply to Andrey V. Elsukov from comment #1)
The patch looks good to me.
Comment 3 Denny Page 2025-10-22 15:50:18 UTC
(In reply to Andrey V. Elsukov from comment #1)
I took a look at the referenced commit, 530c2c30b0c75f1a71df637ae1e09b352f8256cb (ip6_output: Reduce cache misses on pktopts). Not that it is critical that I understand, but are you saying that specific commit introduced the problem, or that a commit that happened later introduced the problem? Thanks.
Comment 4 Mark Johnston freebsd_committer freebsd_triage 2025-10-31 16:38:16 UTC
(In reply to Andrey V. Elsukov from comment #1)
Will you commit this soon?  It would be good to fix in 15.0.

(In reply to Denny Page from comment #3)
I believe that commit introduced the problem.
Comment 5 commit-hook freebsd_committer freebsd_triage 2025-11-02 17:14:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=5568fba657c260286b9f1f1e837ab83ef6ce572d

commit 5568fba657c260286b9f1f1e837ab83ef6ce572d
Author:     Andrey V. Elsukov <ae@FreeBSD.org>
AuthorDate: 2025-11-02 15:56:14 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-11-02 17:10:20 +0000

    mld6: Properly initialize MLD packet options

    After commit 530c2c30b0c7 we need to set flags to ensure that hop-by-hop
    and hop limit options are included.

    PR:             290407
    Reviewed by:    zlei, markj
    MFC after:      3 days
    Fixes:          530c2c30b0c7 ("ip6_output: Reduce cache misses on pktopts")

 sys/netinet6/mld6.c | 1 +
 1 file changed, 1 insertion(+)
Comment 6 commit-hook freebsd_committer freebsd_triage 2025-11-04 13:05:33 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=5c4144fe1f41b16368a3785b7edd6d2d70c24d1b

commit 5c4144fe1f41b16368a3785b7edd6d2d70c24d1b
Author:     Andrey V. Elsukov <ae@FreeBSD.org>
AuthorDate: 2025-11-02 15:56:14 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-11-04 12:46:30 +0000

    mld6: Properly initialize MLD packet options

    After commit 530c2c30b0c7 we need to set flags to ensure that hop-by-hop
    and hop limit options are included.

    PR:             290407
    Reviewed by:    zlei, markj
    MFC after:      3 days
    Fixes:          530c2c30b0c7 ("ip6_output: Reduce cache misses on pktopts")

    (cherry picked from commit 5568fba657c260286b9f1f1e837ab83ef6ce572d)

 sys/netinet6/mld6.c | 1 +
 1 file changed, 1 insertion(+)
Comment 7 commit-hook freebsd_committer freebsd_triage 2025-11-05 19:38:51 UTC
A commit in branch releng/15.0 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=72777e9bf6ad2dec0dadfaa5fe595536f17f7695

commit 72777e9bf6ad2dec0dadfaa5fe595536f17f7695
Author:     Andrey V. Elsukov <ae@FreeBSD.org>
AuthorDate: 2025-11-02 15:56:14 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2025-11-05 19:36:29 +0000

    mld6: Properly initialize MLD packet options

    After commit 530c2c30b0c7 we need to set flags to ensure that hop-by-hop
    and hop limit options are included.

    Approved by:    re (cperciva)
    PR:             290407
    Reviewed by:    zlei, markj
    MFC after:      3 days
    Fixes:          530c2c30b0c7 ("ip6_output: Reduce cache misses on pktopts")

    (cherry picked from commit 5568fba657c260286b9f1f1e837ab83ef6ce572d)
    (cherry picked from commit 5c4144fe1f41b16368a3785b7edd6d2d70c24d1b)

 sys/netinet6/mld6.c | 1 +
 1 file changed, 1 insertion(+)