mirror of
https://gitee.com/openharmony/third_party_libnl
synced 2025-02-25 22:07:13 +00:00
link: call rtnl_link_set_type() in link_msg_parser()
We need to call link-specific ->io_alloc() to alloc addtional structures. Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
690545a20e
commit
ab55ea80a4
@ -541,16 +541,12 @@ static int link_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
|
|||||||
|
|
||||||
if (li[IFLA_INFO_KIND]) {
|
if (li[IFLA_INFO_KIND]) {
|
||||||
struct rtnl_link_info_ops *ops;
|
struct rtnl_link_info_ops *ops;
|
||||||
char *kind;
|
char *kind = nla_get_string(li[IFLA_INFO_KIND]);
|
||||||
int af;
|
int af;
|
||||||
|
|
||||||
kind = nla_strdup(li[IFLA_INFO_KIND]);
|
err = rtnl_link_set_type(link, kind);
|
||||||
if (kind == NULL) {
|
if (err < 0)
|
||||||
err = -NLE_NOMEM;
|
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
|
||||||
link->l_info_kind = kind;
|
|
||||||
link->ce_mask |= LINK_ATTR_LINKINFO;
|
|
||||||
|
|
||||||
if ((af = nl_str2af(kind)) >= 0 &&
|
if ((af = nl_str2af(kind)) >= 0 &&
|
||||||
!af_ops && (af_ops = af_lookup_and_alloc(link, af))) {
|
!af_ops && (af_ops = af_lookup_and_alloc(link, af))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user