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:
parent
ef75c4edf0
commit
847e269c56
1 changed files with 1 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue