]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
add NLM_F_EXCL to rtnl_link_veth_add()
authorCong Wang <xiyou.wangcong@gmail.com>
Wed, 2 Apr 2014 01:03:33 +0000 (18:03 -0700)
committerThomas Haller <thaller@redhat.com>
Wed, 9 Apr 2014 07:10:19 +0000 (09:10 +0200)
rtnl_link_veth_add() is a helper API we provide, it makes sense to
set NLM_F_EXCL for it since it doesn't accept flags as a parameter.

BTW, correct an indention too.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
lib/route/link/veth.c

index b2cfa5491aeeb9793a89f3cc51c17579b67db40d..19c84f89dde6513a149381fca1fe15a1c8d5b21a 100644 (file)
@@ -286,10 +286,10 @@ int rtnl_link_veth_add(struct nl_sock *sock, const char *name,
        }
 
        rtnl_link_set_ns_pid(peer, pid);
-       err = rtnl_link_add(sock, link, NLM_F_CREATE);
+       err = rtnl_link_add(sock, link, NLM_F_CREATE | NLM_F_EXCL);
 
        rtnl_link_put(link);
-        return err;
+       return err;
 }
 
 /** @} */