[PATCH 1/1] link/inet: fix rtnl_link_inet_get_conf() not to allocate inet_data

Thomas Haller thaller at redhat.com
Fri Jul 25 15:26:49 PDT 2014


Instead of allocating a 'struct inet_data', rtnl_link_inet_get_conf()
should only look for an existing entry.

Signed-off-by: Thomas Haller <thaller at redhat.com>
---
 lib/route/link/inet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/route/link/inet.c b/lib/route/link/inet.c
index e94342f..593bab3 100644
--- a/lib/route/link/inet.c
+++ b/lib/route/link/inet.c
@@ -242,7 +242,7 @@ int rtnl_link_inet_get_conf(struct rtnl_link *link, const unsigned int cfgid,
 	if (cfgid == 0 || cfgid > IPV4_DEVCONF_MAX)
 		return -NLE_RANGE;
 
-	if (!(id = rtnl_link_af_alloc(link, &inet_ops)))
+	if (!(id = rtnl_link_af_data(link, &inet_ops)))
 		return -NLE_NOATTR;
 
 	if (!id->i_confset[cfgid - 1])
-- 
1.9.3




More information about the libnl mailing list