struct interface *ifp;
char *name = NULL;
char *kind = NULL;
+ char *desc = NULL;
char *slave_kind = NULL;
struct zebra_ns *zns;
vrf_id_t vrf_id = VRF_DEFAULT;
return -1;
name = (char *)RTA_DATA(tb[IFLA_IFNAME]);
+ if (tb[IFLA_IFALIAS])
+ desc = (char *)RTA_DATA(tb[IFLA_IFALIAS]);
+
if (tb[IFLA_LINKINFO]) {
parse_rtattr_nested(linkinfo, IFLA_INFO_MAX, tb[IFLA_LINKINFO]);
ifp->speed = get_iflink_speed(name);
ifp->ptm_status = ZEBRA_PTM_STATUS_UNKNOWN;
+ if (desc)
+ ifp->desc = XSTRDUP(MTYPE_TMP, desc);
+
/* Set zebra interface type */
zebra_if_set_ziftype(ifp, zif_type, zif_slave_type);
struct interface *ifp;
char *name = NULL;
char *kind = NULL;
+ char *desc = NULL;
char *slave_kind = NULL;
struct zebra_ns *zns;
vrf_id_t vrf_id = VRF_DEFAULT;
if (tb[IFLA_LINK])
link_ifindex = *(ifindex_t *)RTA_DATA(tb[IFLA_LINK]);
+ if (tb[IFLA_IFALIAS]) {
+ desc = (char *)RTA_DATA(tb[IFLA_IFALIAS]);
+ }
+
/* If VRF, create or update the VRF structure itself. */
if (zif_type == ZEBRA_IF_VRF) {
netlink_vrf_change(h, tb[IFLA_LINKINFO], name);
/* See if interface is present. */
ifp = if_lookup_by_name_per_ns(zns, name);
+ if (ifp) {
+ if (ifp->desc)
+ XFREE(MTYPE_TMP, ifp->desc);
+ if (desc)
+ ifp->desc = XSTRDUP(MTYPE_TMP, desc);
+ }
+
if (h->nlmsg_type == RTM_NEWLINK) {
if (tb[IFLA_MASTER]) {
if (slave_kind && (strcmp(slave_kind, "vrf") == 0)) {