Thread (6 messages) 6 messages, 3 authors, 2016-09-16

Re: [PATCH v2] iproute2: build nsid-name cache only for commands that need it

flat view

From: Anton Aksola <hidden>
Date: 2016-09-16 13:18:04

On Fri, Sep 16, 2016 at 11:13:11AM +0200, Nicolas Dichtel wrote:
There is still some differences:
$ cat test.batch
netns add foo
netns set foo 1234
netns list-id

Before your patch:
$ ip -b test.batch
nsid 1234 (iproute2 netns name: foo)

After your patch:
$ ip -b test.batch
nsid 1234
Nicolas,
This seems to be caused by netns_add calling unshare(CLONE_NEWNET).
If we initialize the socket for nsid after that it doesn't seem to work.

Unfortunately I'm not an expert in these details. Should we separate the
socket and cache initialization to different functions and call the
socket init in the beginning of do_netns() as before? What do you think?
I made a quick patch and it seems to work in batch mode now.

BR,
Anton
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help