add NLM_F_EXCL to rtnl_link_veth_add()

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>
This commit is contained in:
Cong Wang 2014-04-01 18:03:33 -07:00 committed by Thomas Haller
parent 3700bf56fa
commit 65f218bcae

View 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;
}
/** @} */