Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/lib/route/link.c b/lib/route/link.c
- index 6d76395..78e860d 100644
- --- a/lib/route/link.c
- +++ b/lib/route/link.c
- @@ -309,6 +309,7 @@ static int link_clone(struct nl_object *_dst, struct nl_object *_src)
- memset(dst->l_af_data, 0, sizeof (dst->l_af_data));
- dst->l_info = NULL;
- dst->l_ifalias = NULL;
- + dst->l_af_ops = NULL;
- dst->l_phys_port_id = NULL;
- dst->l_phys_switch_id = NULL;
- dst->l_vf_list = NULL;
- @@ -345,6 +346,9 @@ static int link_clone(struct nl_object *_dst, struct nl_object *_src)
- }
- }
- + /* Create matching l_af_ops in clone */
- + rtnl_link_set_family(dst, src->l_family);
- +
- if ((err = do_foreach_af(src, af_clone, dst)) < 0)
- return err;
- @@ -608,7 +612,7 @@ static int __link_msg_parser(struct nlmsghdr *n, struct nl_parser_param *pp,
- struct nla_policy *link_policy = rtln_link_policy;
- struct ifinfomsg *ifi;
- struct nlattr *tb[IFLA_MAX+1];
- - int err, family;
- + int err;
- link = rtnl_link_alloc();
- if (link == NULL)
- @@ -620,16 +624,15 @@ static int __link_msg_parser(struct nlmsghdr *n, struct nl_parser_param *pp,
- return -NLE_MSG_TOOSHORT;
- ifi = nlmsg_data(n);
- - link->l_family = family = ifi->ifi_family;
- link->l_arptype = ifi->ifi_type;
- link->l_index = ifi->ifi_index;
- link->l_flags = ifi->ifi_flags;
- link->l_change = ifi->ifi_change;
- - link->ce_mask = (LINK_ATTR_FAMILY |
- - LINK_ATTR_ARPTYPE| LINK_ATTR_IFINDEX |
- + link->ce_mask = (LINK_ATTR_ARPTYPE| LINK_ATTR_IFINDEX |
- LINK_ATTR_FLAGS | LINK_ATTR_CHANGE);
- - if ((link->l_af_ops = af_lookup_and_alloc(link, family))) {
- + rtnl_link_set_family(link, ifi->ifi_family);
- + if (link->l_af_ops) {
- if (link->l_af_ops->ao_protinfo_policy) {
- _NL_STATIC_ASSERT (sizeof(rtln_link_policy) == sizeof(real_link_policy));
- memcpy(&real_link_policy, rtln_link_policy, sizeof(rtln_link_policy));
Add Comment
Please, Sign In to add comment