rtnl_link_bond_add: allow to allocate bond name in case NULL is given

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
This commit is contained in:
Jiri Pirko 2011-11-11 16:01:52 +01:00 committed by Thomas Graf
parent ef75c4edf0
commit 847e269c56

View file

@ -60,15 +60,12 @@ int rtnl_link_bond_add(struct nl_sock *sock, const char *name,
if (!name) {
if (opts)
name = rtnl_link_get_name(opts);
if (!name)
return -NLE_MISSING_ATTR;
}
if ((err = rtnl_link_set_type(link, "bond")) < 0)
goto errout;
if (name)
rtnl_link_set_name(link, name);
err = rtnl_link_add(sock, link, NLM_F_CREATE);