[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <574C6095.9050804@6wind.com>
Date: Mon, 30 May 2016 17:47:33 +0200
From: Nicolas Dichtel <nicolas.dichtel@...nd.com>
To: Vincent Bernat <vincent@...nat.im>
Cc: "David S. Miller" <davem@...emloft.net>,
Vijay Pandurangan <vijayp@...ayp.ca>,
Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org
Subject: Re: [PATCH] veth: delay peer link configuration after interfaces are
tied
Le 30/05/2016 17:26, Vincent Bernat a écrit :
> ❦ 30 mai 2016 17:19 CEST, Nicolas Dichtel <nicolas.dichtel@...nd.com> :
>
>>>>> priv = netdev_priv(peer);
>>>>> rcu_assign_pointer(priv->peer, dev);
>>>>> +
>>>>> + err = rtnl_configure_link(peer, ifmp);
>>>>> + if (err < 0)
>>>>> + goto err_configure_peer;
>>>
>>>> You should fix the error path. 'unregister_netdevice(dev)' is missing.
>>>
>>> I am sending another patch to fix that. I am quite unsure if I do the
>>> right thing here.
>>>
>> A less intrusive fix is to call 'rtmsg_ifinfo(RTM_NEWLINK, peer, ~0U,
>> GFP_KERNEL);' a the end of veth_newlink().
>
> I did that at first. Maybe this would make more sense to do
> that. Otherwise, the first message contains an iflink value that we
> cannot resolve with just the received netlink messages (since the
> information is in the next netlink message). "ip monitor" seems to be
> able to get the info, but I suppose it does an additional
> lookup.
>
Yes, it's a chicken and egg problem ;-)
I think that the first message with an iflink set to '0' is not a problem if a
second one update this value. Daemons that listen to those rtnl messages must
always update their caches. When the peer is put in another netns, its ifindex
may change again.
Powered by blists - more mailing lists