diff options
Diffstat (limited to 'zebra')
| -rw-r--r-- | zebra/zebra_rib.c | 2 | ||||
| -rw-r--r-- | zebra/zebra_rnh.c | 4 | ||||
| -rw-r--r-- | zebra/zebra_vxlan.c | 57 | ||||
| -rw-r--r-- | zebra/zserv.c | 10 |
4 files changed, 47 insertions, 26 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index cc4888f3e7..10e5f55e05 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -520,7 +520,7 @@ static int nexthop_active(afi_t afi, struct route_entry *re, nexthop->ifindex = newhop->ifindex; } return 1; - } else if (CHECK_FLAG(re->flags, ZEBRA_FLAG_INTERNAL)) { + } else if (CHECK_FLAG(re->flags, ZEBRA_FLAG_ALLOW_RECURSION)) { resolved = 0; for (ALL_NEXTHOPS(match->nexthop, newhop)) { if (!CHECK_FLAG(newhop->flags, diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index 9fc5afff0f..d960dbd937 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -1019,6 +1019,8 @@ static int send_client(struct rnh *rnh, struct zserv *client, rnh_type_t type, break; } if (re) { + stream_putc(s, re->type); + stream_putw(s, re->instance); stream_putc(s, re->distance); stream_putl(s, re->metric); num = 0; @@ -1054,6 +1056,8 @@ static int send_client(struct rnh *rnh, struct zserv *client, rnh_type_t type, } stream_putc_at(s, nump, num); } else { + stream_putc(s, 0); // type + stream_putw(s, 0); // instance stream_putc(s, 0); // distance stream_putl(s, 0); // metric stream_putc(s, 0); // nexthops diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 20b9e94288..e07dc6059f 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -1135,7 +1135,8 @@ static void zvni_print_hash(struct hash_backet *backet, void *ctxt[]) "%-10u %-4s %-21s %-8u %-8u %-15u %-37s\n", zvni->vni, "L2", zvni->vxlan_if ? zvni->vxlan_if->name : "unknown", - num_macs, num_neigh, num_vteps, + num_macs, num_neigh, + num_vteps, vrf_id_to_name(zvni->vrf_id)); else { char vni_str[VNI_STR_LEN]; @@ -1858,20 +1859,18 @@ static int zvni_gw_macip_del(struct interface *ifp, zebra_vni_t *zvni, return -1; /* only need to delete the entry from bgp if we sent it before */ - if (advertise_gw_macip_enabled(zvni)) { - if (IS_ZEBRA_DEBUG_VXLAN) - zlog_debug("%u:SVI %s(%u) VNI %u, sending GW MAC %s IP %s del to BGP", - ifp->vrf_id, ifp->name, - ifp->ifindex, zvni->vni, - prefix_mac2str(&(n->emac), - NULL, - ETHER_ADDR_STRLEN), - ipaddr2str(ip, buf2, sizeof(buf2))); - - /* Remove neighbor from BGP. */ - zvni_neigh_send_del_to_client(zvni->vni, &n->ip, &n->emac, - ZEBRA_MACIP_TYPE_GW); - } + if (IS_ZEBRA_DEBUG_VXLAN) + zlog_debug("%u:SVI %s(%u) VNI %u, sending GW MAC %s IP %s del to BGP", + ifp->vrf_id, ifp->name, + ifp->ifindex, zvni->vni, + prefix_mac2str(&(n->emac), + NULL, + ETHER_ADDR_STRLEN), + ipaddr2str(ip, buf2, sizeof(buf2))); + + /* Remove neighbor from BGP. */ + zvni_neigh_send_del_to_client(zvni->vni, &n->ip, &n->emac, + ZEBRA_MACIP_TYPE_GW); /* Delete this neighbor entry. */ zvni_neigh_del(zvni, n); @@ -6256,15 +6255,33 @@ int zebra_vxlan_if_update(struct interface *ifp, u_int16_t chgflags) zebra_vxlan_process_l3vni_oper_down(zl3vni); zl3vni->svi_if = NULL; zl3vni->svi_if = zl3vni_map_to_svi_if(zl3vni); + zl3vni->local_vtep_ip = vxl->vtep_ip; if (is_l3vni_oper_up(zl3vni)) zebra_vxlan_process_l3vni_oper_up( zl3vni); } } + /* + * local-ip change - process oper down, associate with new + * local-ip and then process oper up again + */ + if (chgflags & ZEBRA_VXLIF_LOCAL_IP_CHANGE) { + if (if_is_operative(ifp)) { + zebra_vxlan_process_l3vni_oper_down(zl3vni); + zl3vni->local_vtep_ip = vxl->vtep_ip; + if (is_l3vni_oper_up(zl3vni)) + zebra_vxlan_process_l3vni_oper_up( + zl3vni); + } + } + + /* Update local tunnel IP. */ + zl3vni->local_vtep_ip = vxl->vtep_ip; + /* if we have a valid new master, process l3-vni oper up */ if (chgflags & ZEBRA_VXLIF_MASTER_CHANGE) { - if (is_l3vni_oper_up(zl3vni)) + if (if_is_operative(ifp) && is_l3vni_oper_up(zl3vni)) zebra_vxlan_process_l3vni_oper_up(zl3vni); } } else { @@ -6704,6 +6721,10 @@ int zebra_vxlan_advertise_gw_macip(struct zserv *client, u_short length, struct interface *vlan_if = NULL; struct interface *vrr_if = NULL; + zvni = zvni_lookup(vni); + if (!zvni) + return 0; + if (IS_ZEBRA_DEBUG_VXLAN) zlog_debug( "EVPN gateway macip Adv %s on VNI %d , currently %s", @@ -6712,10 +6733,6 @@ int zebra_vxlan_advertise_gw_macip(struct zserv *client, u_short length, ? "enabled" : "disabled"); - zvni = zvni_lookup(vni); - if (!zvni) - return 0; - if (zvni->advertise_gw_macip == advertise) return 0; diff --git a/zebra/zserv.c b/zebra/zserv.c index 1fc2bfd309..07258cdb72 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -1167,12 +1167,12 @@ static int zread_route_add(struct zserv *client, u_short length, switch (api_nh->type) { case NEXTHOP_TYPE_IFINDEX: nexthop = route_entry_nexthop_ifindex_add( - re, api_nh->ifindex, re->vrf_id); + re, api_nh->ifindex, api_nh->vrf_id); break; case NEXTHOP_TYPE_IPV4: nexthop = route_entry_nexthop_ipv4_add( re, &api_nh->gate.ipv4, NULL, - re->vrf_id); + api_nh->vrf_id); break; case NEXTHOP_TYPE_IPV4_IFINDEX: @@ -1187,7 +1187,7 @@ static int zread_route_add(struct zserv *client, u_short length, nexthop = route_entry_nexthop_ipv4_ifindex_add( re, &api_nh->gate.ipv4, NULL, ifindex, - re->vrf_id); + api_nh->vrf_id); /* if this an EVPN route entry, * program the nh as neigh @@ -1209,7 +1209,7 @@ static int zread_route_add(struct zserv *client, u_short length, break; case NEXTHOP_TYPE_IPV6: nexthop = route_entry_nexthop_ipv6_add( - re, &api_nh->gate.ipv6, re->vrf_id); + re, &api_nh->gate.ipv6, api_nh->vrf_id); break; case NEXTHOP_TYPE_IPV6_IFINDEX: memset(&vtep_ip, 0, sizeof(struct ipaddr)); @@ -1223,7 +1223,7 @@ static int zread_route_add(struct zserv *client, u_short length, nexthop = route_entry_nexthop_ipv6_ifindex_add( re, &api_nh->gate.ipv6, ifindex, - re->vrf_id); + api_nh->vrf_id); /* if this an EVPN route entry, * program the nh as neigh |
