ifp->speed = get_iflink_speed(ifp);
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);
if (IS_ZEBRA_IF_VRF(ifp))
zif = (struct zebra_if *)ifp->info;
zif->link_ifindex = link_ifindex;
+ if (desc) {
+ XFREE(MTYPE_TMP, zif->desc);
+ zif->desc = XSTRDUP(MTYPE_TMP, desc);
+ }
+
/* Hardware type and address. */
ifp->ll_type = netlink_to_zebra_link_type(ifi->ifi_type);
netlink_interface_update_hw_addr(tb, ifp);
ifindex_t bond_ifindex = IFINDEX_INTERNAL;
ifindex_t link_ifindex = IFINDEX_INTERNAL;
uint8_t old_hw_addr[INTERFACE_HWADDR_MAX];
-
+ struct zebra_if *zif;
zns = zebra_ns_lookup(ns_id);
ifi = NLMSG_DATA(h);
/* See if interface is present. */
ifp = if_lookup_by_name_per_ns(zns, name);
- if (ifp) {
- 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)
if_delete_update(ifp);
}
+ zif = ifp->info;
+ if (zif) {
+ XFREE(MTYPE_TMP, zif->desc);
+ if (desc)
+ zif->desc = XSTRDUP(MTYPE_TMP, desc);
+ }
+
return 0;
}
list_delete(&rtadv->AdvDNSSLList);
#endif /* HAVE_RTADV */
+ XFREE(MTYPE_TMP, zebra_if->desc);
THREAD_OFF(zebra_if->speed_update);
XFREE(MTYPE_ZINFO, zebra_if);
if (ifp->desc)
vty_out(vty, " Description: %s\n", ifp->desc);
+ if (zebra_if->desc)
+ vty_out(vty, " OS Description: %s\n", zebra_if->desc);
+
if (ifp->ifindex == IFINDEX_INTERNAL) {
vty_out(vty, " pseudo interface\n");
return;
vty_out(vty, "Interface Status Protocol Description\n");
FOR_ALL_INTERFACES (vrf, ifp) {
int len;
+ struct zebra_if *zif;
+ bool intf_desc;
+
+ intf_desc = false;
len = vty_out(vty, "%s", ifp->name);
vty_out(vty, "%*s", (16 - len), " ");
vty_out(vty, "down down ");
}
- if (ifp->desc)
+ if (ifp->desc) {
+ intf_desc = true;
vty_out(vty, "%s", ifp->desc);
+ }
+ zif = ifp->info;
+ if (zif && zif->desc) {
+ vty_out(vty, "%s%s",
+ intf_desc
+ ? "\n "
+ : "",
+ zif->desc);
+ }
+
vty_out(vty, "\n");
}
}
bool v6_2_v4_ll_neigh_entry;
char neigh_mac[6];
struct in6_addr v6_2_v4_ll_addr6;
+
+ /* The description of the interface */
+ char *desc;
};
DECLARE_HOOK(zebra_if_extra_info, (struct vty * vty, struct interface *ifp),