Set Socket interface using interface index

未关闭
#458 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@boris-n 已经在做这个了。

开始于 2025年5月24日。

  • #582 来自 @boris-n —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
rust
领域
networking

调研方向

首先阅读 sockets2 的 set_multicast_if_v4 函数,并将其基于地址的行为与 issue 中展示的使用 ip_mreqn 的 C setsockopt 调用进行比较。当 sockets2 提供一种按索引选择 IPv4 多播接口的方式,且相关测试覆盖了该行为时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

enhancement

In C, one can set a socket's interface using setsockopt(socket, SOL_IP, IP_MULTICAST_IF, &mreqn, sizeof(mreqn)) where mreqn is

struct ip_mreqn {
    struct in_addr imr_multiaddr; /* IP multicast group address */
    struct in_addr imr_address;   /* IP address of local interface */
    int            imr_ifindex;   /* interface index */
};

sockets2 offers the set_multicast_if_v4 function, but only accepts an address as parameter. I would like to set the interface using sockets2 based on an interface index.

主要语言
Rust
星标
885
派生
328
平均合并
6 天 12 小时
30 天内合并 PR
2

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

rust-lang/socket2 的其他 Issue

查看 rust-lang/socket2 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。