summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/route/link.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/route/link.c b/lib/route/link.c
index 0bb90a0..a016899 100644
--- a/lib/route/link.c
+++ b/lib/route/link.c
@@ -523,6 +523,7 @@ static int link_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
if (li[IFLA_INFO_KIND]) {
struct rtnl_link_info_ops *ops;
char *kind;
+ int af;
kind = nla_strdup(li[IFLA_INFO_KIND]);
if (kind == NULL) {
@@ -532,6 +533,16 @@ static int link_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
link->l_info_kind = kind;
link->ce_mask |= LINK_ATTR_LINKINFO;
+ if ((af = nl_str2af(kind)) >= 0 &&
+ !af_ops && (af_ops = af_lookup_and_alloc(link, af))) {
+
+ if (af_ops->ao_protinfo_policy) {
+ tb[IFLA_PROTINFO] = (struct nlattr *)af_ops->ao_protinfo_policy;
+ }
+ link->l_family = family = af;
+ link->l_af_ops = af_ops;
+ }
+
ops = rtnl_link_info_ops_lookup(kind);
link->l_info_ops = ops;