Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement join/leave_multicast_group() for IPv6 #914

Merged
merged 8 commits into from
May 14, 2024

Conversation

lucasvr
Copy link
Contributor

@lucasvr lucasvr commented Apr 2, 2024

This patch rebases @jgallagher's PR #602 to the tip of the main branch, adding support for IPv6 multicast groups.

As in the original PR, it is possible to join groups by sending an initial MLDv2 Report packet. In addition to PR #602, this PR also implements leave_multicast_group().

It is not yet possible to resend the change report or respond to queries.

@lucasvr lucasvr force-pushed the lucas/multicastv6 branch 2 times, most recently from d5939b8 to dc64814 Compare April 2, 2024 21:58
Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 94.32314% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 79.97%. Comparing base (4c27918) to head (6c06cd9).
Report is 10 commits behind head on main.

❗ Current head 6c06cd9 differs from pull request most recent head 20aa66b. Consider uploading reports for the commit 20aa66b to get more accurate results

Files Patch % Lines
src/iface/interface/igmp.rs 86.20% 4 Missing ⚠️
src/iface/packet.rs 86.66% 4 Missing ⚠️
src/iface/interface/ipv6.rs 94.91% 3 Missing ⚠️
src/wire/ipv6option.rs 96.49% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #914      +/-   ##
==========================================
+ Coverage   79.96%   79.97%   +0.01%     
==========================================
  Files          82       81       -1     
  Lines       28378    27831     -547     
==========================================
- Hits        22693    22259     -434     
+ Misses       5685     5572     -113     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This patch rebases @jgallagher's to the tip of the main branch,
adding support for IPv6 multicast groups. As in the original PR,
it is only possible to join groups by sending an initial MLDv2
Report packet. It is not yet possible to resend the change report,
leave groups, respond to queries, etc.
Also, modify `test_join_ipv6_multicast_group()` so that it joins
the mDNS multicast group instead of 0xfe80::1. Because the lower 24
bits of 0xfe80::01 match the lower part of the IPv6 address assigned
to the test device by `crate::tests::setup()`, `has_multicast_group()`
would always returns `true`.
@lucasvr lucasvr changed the title Update PR #602: implement join_multicast_group() for IPv6 Implement join/leave_multicast_group() for IPv6 Apr 17, 2024
@lucasvr
Copy link
Contributor Author

lucasvr commented Apr 17, 2024

Folks, I would appreciate if someone could review this PR. For symmetry, in addition to @jgallagher's original pull request, this PR implements leave_multicast_group(). This pair of functions is enough to commission and control devices that use the Matter protocol.

Copy link
Contributor

@thvdveld thvdveld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think everything looks good. Just a small thing that I noticed.

src/iface/interface/igmp.rs Outdated Show resolved Hide resolved
No part of the code uses this anymore.
@lucasvr lucasvr requested a review from thvdveld April 22, 2024 17:13
src/wire/ipv6hbh.rs Outdated Show resolved Hide resolved
Cargo.toml Show resolved Hide resolved
src/iface/interface/ipv6.rs Outdated Show resolved Hide resolved
src/iface/interface/tests/ipv6.rs Outdated Show resolved Hide resolved
src/wire/mld.rs Outdated Show resolved Hide resolved
- Handle payload copy outside of mld::AddressRecordRepr::emit()
- On unit test, use the parsed Hop-by-Hop option instead of checking
  that the wire representation of the two structures is the same
- Minor code changes
@lucasvr lucasvr requested a review from thvdveld May 2, 2024 15:58
src/wire/mld.rs Outdated Show resolved Hide resolved
- Split mldv2_router_alert() in two, adding a new function named
  push_padn_option(u8) to emit a PadN hop-by-hop option after any
  other options have been pushed already
- When emiting ReportRecordReprs, remove the conditional block
  that attempted to copy payload data over the destination record
@lucasvr lucasvr requested a review from thvdveld May 10, 2024 14:37
@thvdveld thvdveld added this pull request to the merge queue May 14, 2024
@thvdveld
Copy link
Contributor

I think we can merge this now. Thank you for your PR!

Merged via the queue into smoltcp-rs:main with commit 35bb01a May 14, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants