Skip to content

bind_device_by_index fails on IPv6 #413

@bryanlarsen

Description

@bryanlarsen

Calling bind_device_by_index results in errno 22 if the socket is bound to an IPV6 address.

I'm using this code instead:

    unsafe { libc::setsockopt(socket.as_raw_fd(), libc::IPPROTO_IPV6, libc::IPV6_BOUND_IF, &index as *const u32 as *const libc::c_void, std::mem::size_of::<u32>() as u32) } ;

device_index has the same problem.

P.S. if somebody knows a better way of specifying a link-local scope ID when binding to an IPV6 socket, that would help me although the bug I opened is still valid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions