From: Marcos Paulo de Souza Date: Thu, 4 Jan 2018 22:24:55 +0000 (-0200) Subject: lib/veth.c: Disassociate link name of peer name X-Git-Tag: libnl3_5_0~51 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac72624e9c00ba4b9ce7db93ba125a6b03ee6b77;p=libnl lib/veth.c: Disassociate link name of peer name 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 https://github.com/thom311/libnl/pull/162 --- diff --git a/lib/route/link/veth.c b/lib/route/link/veth.c index 0cc3a4a..bd30041 100644 --- a/lib/route/link/veth.c +++ b/lib/route/link/veth.c @@ -282,10 +282,10 @@ int rtnl_link_veth_add(struct nl_sock *sock, const char *name, 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);