Skip to content

Question: How to bind to netlink on Linux? #1260

@al8n

Description

@al8n

Hi, when using rustix on linux, I found that it seems that there is no socketaddr_nl, and cannot bind to netlink.

    let mut sa: sockaddr_nl = mem::zeroed();
    sa.nl_family = AF_NETLINK as u16;

    if bind(
      sock,
      &sa as *const sockaddr_nl as *const _,
      mem::size_of::<sockaddr_nl>() as socklen_t,
    ) < 0
    {
      return Err(io::Error::last_os_error());
    }

The above libc code cannot use rustix to achieve.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions