Skip to content

Add ability to resolve (and cache) multicast groups for a given family name#16

Merged
cathay4t merged 1 commit into
rust-netlink:mainfrom
Sh3Rm4n:feat/multi-cast
Jun 20, 2026
Merged

Add ability to resolve (and cache) multicast groups for a given family name#16
cathay4t merged 1 commit into
rust-netlink:mainfrom
Sh3Rm4n:feat/multi-cast

Conversation

@Sh3Rm4n

@Sh3Rm4n Sh3Rm4n commented Sep 5, 2025

Copy link
Copy Markdown
Contributor

Continuation of #12

Comment thread src/resolver.rs Outdated
let mut genlmsg: GenlMessage<GenlCtrl> =
GenlMessage::from_payload(GenlCtrl {
cmd: GenlCtrlCmd::GetFamily,
nlas: vec![GenlCtrlAttrs::FamilyName(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If this multicast group is also in GetFamily reply, I think we should merge this function into query_family_id(), so we have single netlink request to get both caches ready.

@Sh3Rm4n Sh3Rm4n Dec 2, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point. But in that case query_family_ids function signature does not really fit anymore.

What about

fn query_family(&mut self, handle: &GenetlinkHandle, family_name: &str) -> (u16, HashMap<String, u32>)

which returns both id and the groups. At this point, I should probably introduce a struct instead of the tuple from above.

We could still keep query_family_id (and query_family_multicast_groups, which would call query_family internally for backwards compatibility. WDTY?

@cathay4t

Copy link
Copy Markdown
Member

@Sh3Rm4n ping

@Sh3Rm4n
Sh3Rm4n requested a review from cathay4t March 11, 2026 09:47
@Sh3Rm4n

Sh3Rm4n commented Mar 11, 2026

Copy link
Copy Markdown
Contributor Author

I've unified the interface based on #16 (comment)

Instead of removing, I've deprecated obsolete functions, so that this PR is not a breaking change. If this doesn't matter, I could remove those deprecated functions as well.

@Sh3Rm4n
Sh3Rm4n force-pushed the feat/multi-cast branch 2 times, most recently from 77e85fa to c7e6ba3 Compare March 11, 2026 09:53
@cathay4t

Copy link
Copy Markdown
Member

I have amended the patch:

  1. Squash into single commit.
  2. Fixed the test code to use new query_family() instead of deprecated query_family_id().

@cathay4t
cathay4t merged commit 081d5cf into rust-netlink:main Jun 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants