[patch libnl] rtnl_link_bond_add: allow to allocate bond name in case NULL is given

Jiri Pirko jpirko at redhat.com
Fri Nov 11 10:01:52 EST 2011


Signed-off-by: Jiri Pirko <jpirko at redhat.com>
---
 lib/route/link/bonding.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/lib/route/link/bonding.c b/lib/route/link/bonding.c
index 5788f69..5e78084 100644
--- a/lib/route/link/bonding.c
+++ b/lib/route/link/bonding.c
@@ -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);
-- 
1.7.6




More information about the libnl mailing list