Based in the function documentation, peer name could be set regardless
of the link name being informed of not. These parameters should be
checked independently.
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
https://github.com/thom311/libnl/pull/162
return -NLE_NOMEM;
peer = link->l_info;
- if (name && peer_name) {
+ if (name)
rtnl_link_set_name(link, name);
+ if (peer_name)
rtnl_link_set_name(peer, peer_name);
- }
rtnl_link_set_ns_pid(peer, pid);
err = rtnl_link_add(sock, link, NLM_F_CREATE | NLM_F_EXCL);