Skip to content
This repository was archived by the owner on Oct 26, 2022. It is now read-only.
This repository was archived by the owner on Oct 26, 2022. It is now read-only.

LinkGetRequest using Nla::NetNsFd does not list interfaces in a namespace #277

@pdtilton

Description

@pdtilton

Using Nla::NetNsFd does not seem to work with LinkGetRequest, but it does work with LinkSetRequest. Is there a supported method for getting all interfaces in a specific network namespace without moving the process into the namespace?

For my test case I added a namespace and create a device within that namespace.

ip netns add foo
ip netns exec foo ip link add dev1 up type bridge

The following snippet first gets the links in the root namespace, then attempts to get the links in the "foo" namespace.

let links = handle.link().get().execute();

//Dumps links in the root namespace

let f = std::fs::File::open("/var/run/netns/foo")?;

let mut get = handle.link().get();
get.message_mut().nlas.push(Nla::NetNsFd(f.as_raw_fd()));

let links = get.execute();

// Also dumps links in the root namespace, but I expect links from the "foo" namespace

I've also tried using Nla::NetnsId and Nla::IfNetnsId, with similar results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions