link: Keep reference to af_ops during lifetime of link object

Signed-off-by: Thomas Graf <tgraf@suug.ch>
This commit is contained in:
Thomas Graf 2013-02-05 13:18:25 +01:00
parent 8b8e26b333
commit 2d36371aa1
2 changed files with 6 additions and 0 deletions

View file

@ -183,6 +183,8 @@ struct rtnl_link
uint32_t l_num_rx_queues;
uint32_t l_group;
uint8_t l_carrier;
/* 3 byte hole */
struct rtnl_link_af_ops * l_af_ops;
};
struct rtnl_ncacheinfo

View file

@ -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);