diff options
Diffstat (limited to 'zebra/interface.c')
| -rw-r--r-- | zebra/interface.c | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 4b708496a1..7fd967dd8b 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1066,14 +1066,18 @@ void if_up(struct interface *ifp) zif->link_ifindex); if (link_if) zebra_vxlan_svi_up(ifp, link_if); - } else if (IS_ZEBRA_IF_MACVLAN(ifp)) + } else if (IS_ZEBRA_IF_MACVLAN(ifp)) { zebra_vxlan_macvlan_up(ifp); + } if (zif->es_info.es) zebra_evpn_es_if_oper_state_change(zif, true /*up*/); if (zif->flags & ZIF_FLAG_EVPN_MH_UPLINK) zebra_evpn_mh_uplink_oper_update(zif); + + thread_add_timer(zrouter.master, if_zebra_speed_update, ifp, 0, + &zif->speed_update); } /* Interface goes down. We have to manage different behavior of based @@ -1105,8 +1109,9 @@ void if_down(struct interface *ifp) zif->link_ifindex); if (link_if) zebra_vxlan_svi_down(ifp, link_if); - } else if (IS_ZEBRA_IF_MACVLAN(ifp)) + } else if (IS_ZEBRA_IF_MACVLAN(ifp)) { zebra_vxlan_macvlan_down(ifp); + } if (zif->es_info.es) zebra_evpn_es_if_oper_state_change(zif, false /*up*/); @@ -1148,18 +1153,16 @@ void zebra_if_update_link(struct interface *ifp, ifindex_t link_ifindex, * during initial link dump kernel does not order lower devices before * upper devices so we need to fixup link dependencies at the end of dump */ -void zebra_if_update_all_links(void) +void zebra_if_update_all_links(struct zebra_ns *zns) { struct route_node *rn; struct interface *ifp; struct zebra_if *zif; - struct zebra_ns *ns; if (IS_ZEBRA_DEBUG_KERNEL) zlog_info("fixup link dependencies"); - ns = zebra_ns_lookup(NS_DEFAULT); - for (rn = route_top(ns->if_table); rn; rn = route_next(rn)) { + for (rn = route_top(zns->if_table); rn; rn = route_next(rn)) { ifp = (struct interface *)rn->info; if (!ifp) continue; @@ -1177,8 +1180,8 @@ void zebra_if_update_all_links(void) /* update SVI linkages */ if ((zif->link_ifindex != IFINDEX_INTERNAL) && !zif->link) { - zif->link = if_lookup_by_index_per_ns(ns, - zif->link_ifindex); + zif->link = if_lookup_by_index_per_ns( + zns, zif->link_ifindex); if (IS_ZEBRA_DEBUG_KERNEL) zlog_debug("interface %s/%d's lower fixup to %s/%d", ifp->name, ifp->ifindex, @@ -1304,6 +1307,9 @@ static const char *zebra_ziftype_2str(zebra_iftype_t zif_type) case ZEBRA_IF_MACVLAN: return "macvlan"; + case ZEBRA_IF_GRE: + return "GRE"; + default: return "Unknown"; } @@ -1576,6 +1582,28 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp) ifp->name); } vty_out(vty, "\n"); + } else if (IS_ZEBRA_IF_GRE(ifp)) { + struct zebra_l2info_gre *gre_info; + + gre_info = &zebra_if->l2info.gre; + if (gre_info->vtep_ip.s_addr != INADDR_ANY) { + vty_out(vty, " VTEP IP: %pI4", &gre_info->vtep_ip); + if (gre_info->vtep_ip_remote.s_addr != INADDR_ANY) + vty_out(vty, " , remote %pI4", + &gre_info->vtep_ip_remote); + vty_out(vty, "\n"); + } + if (gre_info->ifindex_link && + (gre_info->link_nsid != NS_UNKNOWN)) { + struct interface *ifp; + + ifp = if_lookup_by_index_per_ns( + zebra_ns_lookup(gre_info->link_nsid), + gre_info->ifindex_link); + vty_out(vty, " Link Interface %s\n", + ifp == NULL ? "Unknown" : + ifp->name); + } } if (IS_ZEBRA_IF_BRIDGE_SLAVE(ifp)) { |
