]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
link/inet: fix rtnl_link_inet_get_conf() not to allocate inet_data
authorThomas Haller <thaller@redhat.com>
Fri, 25 Jul 2014 22:26:49 +0000 (00:26 +0200)
committerThomas Haller <thaller@redhat.com>
Sun, 27 Jul 2014 09:01:14 +0000 (11:01 +0200)
Instead of allocating a 'struct inet_data', rtnl_link_inet_get_conf()
should only look for an existing entry.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
lib/route/link/inet.c

index f16675509ca70a5a818071aaf7d2d42b920caec3..3bd76cc648057b5b0ea8ee57ee486ef4ed886829 100644 (file)
@@ -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])