vf_spoofchk->setting);
}
+ if (vf[IFLA_VF_IB_NODE_GUID]) {
+ struct ifla_vf_guid *guid = RTA_DATA(vf[IFLA_VF_IB_NODE_GUID]);
+ uint64_t node_guid = ntohll(guid->guid);
+
+ print_string(PRINT_ANY, "node guid", ", NODE_GUID %s",
+ ll_addr_n2a((const unsigned char *)&node_guid,
+ sizeof(node_guid), ARPHRD_INFINIBAND,
+ b1, sizeof(b1)));
+ }
+ if (vf[IFLA_VF_IB_PORT_GUID]) {
+ struct ifla_vf_guid *guid = RTA_DATA(vf[IFLA_VF_IB_PORT_GUID]);
+ uint64_t port_guid = ntohll(guid->guid);
+
+ print_string(PRINT_ANY, "port guid", ", PORT_GUID %s",
+ ll_addr_n2a((const unsigned char *)&port_guid,
+ sizeof(port_guid), ARPHRD_INFINIBAND,
+ b1, sizeof(b1)));
+ }
if (vf[IFLA_VF_LINK_STATE]) {
struct ifla_vf_link_state *vf_linkstate =
RTA_DATA(vf[IFLA_VF_LINK_STATE]);
if (filter.up && !(ifi->ifi_flags&IFF_UP))
return -1;
- parse_rtattr(tb, IFLA_MAX, IFLA_RTA(ifi), len);
+ parse_rtattr_flags(tb, IFLA_MAX, IFLA_RTA(ifi), len, NLA_F_NESTED);
name = get_ifname_rta(ifi->ifi_index, tb[IFLA_IFNAME]);
if (!name)
close_json_array(PRINT_JSON, NULL);
}
- print_string(PRINT_FP, NULL, "%s", "\n");
+ if (tb[IFLA_PROP_LIST]) {
+ struct rtattr *i, *proplist = tb[IFLA_PROP_LIST];
+ int rem = RTA_PAYLOAD(proplist);
+
+ open_json_array(PRINT_JSON, "altnames");
+ for (i = RTA_DATA(proplist); RTA_OK(i, rem);
+ i = RTA_NEXT(i, rem)) {
+ if (i->rta_type != IFLA_ALT_IFNAME)
+ continue;
+ print_string(PRINT_FP, NULL, "%s altname ", _SL_);
+ print_string(PRINT_ANY, NULL,
+ "%s", rta_getattr_str(i));
+ }
+ close_json_array(PRINT_JSON, NULL);
+ }
+
+ print_string(PRINT_FP, NULL, "%s", _SL_);
fflush(fp);
return 1;
}
if (set_lifetime(&preferred_lft, *argv))
invarg("preferred_lft value", *argv);
} else if (strcmp(*argv, "home") == 0) {
- ifa_flags |= IFA_F_HOMEADDRESS;
+ if (req.ifa.ifa_family == AF_INET6)
+ ifa_flags |= IFA_F_HOMEADDRESS;
+ else
+ fprintf(stderr, "Warning: home option can be set only for IPv6 addresses\n");
} else if (strcmp(*argv, "nodad") == 0) {
- ifa_flags |= IFA_F_NODAD;
+ if (req.ifa.ifa_family == AF_INET6)
+ ifa_flags |= IFA_F_NODAD;
+ else
+ fprintf(stderr, "Warning: nodad option can be set only for IPv6 addresses\n");
} else if (strcmp(*argv, "mngtmpaddr") == 0) {
- ifa_flags |= IFA_F_MANAGETEMPADDR;
+ if (req.ifa.ifa_family == AF_INET6)
+ ifa_flags |= IFA_F_MANAGETEMPADDR;
+ else
+ fprintf(stderr, "Warning: mngtmpaddr option can be set only for IPv6 addresses\n");
} else if (strcmp(*argv, "noprefixroute") == 0) {
ifa_flags |= IFA_F_NOPREFIXROUTE;
} else if (strcmp(*argv, "autojoin") == 0) {