link: Keep reference to af_ops during lifetime of link object
Signed-off-by: Thomas Graf <tgraf@suug.ch>
This commit is contained in:
parent
8b8e26b333
commit
2d36371aa1
2 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue