summaryrefslogtreecommitdiffstats
path: root/lib/route/link.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2013-02-05 12:18:25 (GMT)
committerThomas Graf <tgraf@suug.ch>2013-02-05 12:18:25 (GMT)
commit2d36371aa1ff7d3ecf18e6ca93a8b5fd9c1e8f0e (patch)
tree489d71b186ecc911e6dc83c94b5b31cf9883465f /lib/route/link.c
parent8b8e26b33304c56370096cecbe58fdb3ede318c2 (diff)
downloadlibnl-2d36371aa1ff7d3ecf18e6ca93a8b5fd9c1e8f0e.zip
libnl-2d36371aa1ff7d3ecf18e6ca93a8b5fd9c1e8f0e.tar.gz
libnl-2d36371aa1ff7d3ecf18e6ca93a8b5fd9c1e8f0e.tar.bz2
link: Keep reference to af_ops during lifetime of link object
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Diffstat (limited to 'lib/route/link.c')
-rw-r--r--lib/route/link.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/route/link.c b/lib/route/link.c
index e395529..752f63a 100644
--- a/lib/route/link.c
+++ b/lib/route/link.c
@@ -201,6 +201,8 @@ static void link_free_data(struct nl_object *c)
if ((io = link->l_info_ops) != NULL)
release_link_info(link);
+ rtnl_link_af_ops_put(link->l_af_ops);
+
nl_addr_put(link->l_addr);
nl_addr_put(link->l_bcast);
@@ -313,6 +315,8 @@ static int link_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
af_ops->ao_protinfo_policy,
sizeof(struct nla_policy));
}
+
+ link->l_af_ops = af_ops;
}
err = nlmsg_parse(n, sizeof(*ifi), tb, IFLA_MAX, link_policy);