mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 09:52:27 +00:00
Merge pull request #1809 from donaldsharp/intf_json
vrf nexthop cleanups
This commit is contained in:
commit
41d19ab553
@ -1054,6 +1054,9 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
|
|||||||
else
|
else
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
api_nh = &api.nexthops[valid_nh_count];
|
||||||
|
api_nh->vrf_id = bgp->vrf_id;
|
||||||
|
|
||||||
if (nh_family == AF_INET) {
|
if (nh_family == AF_INET) {
|
||||||
struct in_addr *nexthop;
|
struct in_addr *nexthop;
|
||||||
|
|
||||||
@ -1078,9 +1081,7 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
|
|||||||
|
|
||||||
nexthop = &mpinfo_cp->attr->nexthop;
|
nexthop = &mpinfo_cp->attr->nexthop;
|
||||||
|
|
||||||
api_nh = &api.nexthops[valid_nh_count];
|
|
||||||
api_nh->gate.ipv4 = *nexthop;
|
api_nh->gate.ipv4 = *nexthop;
|
||||||
api_nh->vrf_id = bgp->vrf_id;
|
|
||||||
/* EVPN type-2 routes are
|
/* EVPN type-2 routes are
|
||||||
programmed as onlink on l3-vni SVI
|
programmed as onlink on l3-vni SVI
|
||||||
*/
|
*/
|
||||||
@ -1135,7 +1136,6 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
|
|||||||
if (ifindex == 0)
|
if (ifindex == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
api_nh = &api.nexthops[valid_nh_count];
|
|
||||||
api_nh->gate.ipv6 = *nexthop;
|
api_nh->gate.ipv6 = *nexthop;
|
||||||
api_nh->ifindex = ifindex;
|
api_nh->ifindex = ifindex;
|
||||||
api_nh->type = NEXTHOP_TYPE_IPV6_IFINDEX;
|
api_nh->type = NEXTHOP_TYPE_IPV6_IFINDEX;
|
||||||
|
@ -1085,7 +1085,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
|
|||||||
STREAM_GETC(s, api->message);
|
STREAM_GETC(s, api->message);
|
||||||
STREAM_GETC(s, api->safi);
|
STREAM_GETC(s, api->safi);
|
||||||
if (CHECK_FLAG(api->flags, ZEBRA_FLAG_EVPN_ROUTE))
|
if (CHECK_FLAG(api->flags, ZEBRA_FLAG_EVPN_ROUTE))
|
||||||
stream_get(&(api->rmac), s, sizeof(struct ethaddr));
|
STREAM_GET(&(api->rmac), s, sizeof(struct ethaddr));
|
||||||
|
|
||||||
/* Prefix. */
|
/* Prefix. */
|
||||||
STREAM_GETC(s, api->prefix.family);
|
STREAM_GETC(s, api->prefix.family);
|
||||||
|
@ -676,6 +676,7 @@ static int ospf_zebra_send_mpls_ftn(int cmd, struct sr_nhlfe nhlfe)
|
|||||||
SET_FLAG(api.message, ZAPI_MESSAGE_LABEL);
|
SET_FLAG(api.message, ZAPI_MESSAGE_LABEL);
|
||||||
api_nh->labels[0] = nhlfe.label_out;
|
api_nh->labels[0] = nhlfe.label_out;
|
||||||
api_nh->label_num = 1;
|
api_nh->label_num = 1;
|
||||||
|
api_nh->vrf_id = VRF_DEFAULT;
|
||||||
api.nexthop_num = 1;
|
api.nexthop_num = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1166,12 +1166,12 @@ static int zread_route_add(struct zserv *client, u_short length,
|
|||||||
switch (api_nh->type) {
|
switch (api_nh->type) {
|
||||||
case NEXTHOP_TYPE_IFINDEX:
|
case NEXTHOP_TYPE_IFINDEX:
|
||||||
nexthop = route_entry_nexthop_ifindex_add(
|
nexthop = route_entry_nexthop_ifindex_add(
|
||||||
re, api_nh->ifindex, re->vrf_id);
|
re, api_nh->ifindex, api_nh->vrf_id);
|
||||||
break;
|
break;
|
||||||
case NEXTHOP_TYPE_IPV4:
|
case NEXTHOP_TYPE_IPV4:
|
||||||
nexthop = route_entry_nexthop_ipv4_add(
|
nexthop = route_entry_nexthop_ipv4_add(
|
||||||
re, &api_nh->gate.ipv4, NULL,
|
re, &api_nh->gate.ipv4, NULL,
|
||||||
re->vrf_id);
|
api_nh->vrf_id);
|
||||||
break;
|
break;
|
||||||
case NEXTHOP_TYPE_IPV4_IFINDEX: {
|
case NEXTHOP_TYPE_IPV4_IFINDEX: {
|
||||||
|
|
||||||
@ -1188,7 +1188,7 @@ static int zread_route_add(struct zserv *client, u_short length,
|
|||||||
|
|
||||||
nexthop = route_entry_nexthop_ipv4_ifindex_add(
|
nexthop = route_entry_nexthop_ipv4_ifindex_add(
|
||||||
re, &api_nh->gate.ipv4, NULL, ifindex,
|
re, &api_nh->gate.ipv4, NULL, ifindex,
|
||||||
re->vrf_id);
|
api_nh->vrf_id);
|
||||||
|
|
||||||
/* if this an EVPN route entry,
|
/* if this an EVPN route entry,
|
||||||
program the nh as neigh
|
program the nh as neigh
|
||||||
@ -1211,12 +1211,12 @@ static int zread_route_add(struct zserv *client, u_short length,
|
|||||||
}
|
}
|
||||||
case NEXTHOP_TYPE_IPV6:
|
case NEXTHOP_TYPE_IPV6:
|
||||||
nexthop = route_entry_nexthop_ipv6_add(
|
nexthop = route_entry_nexthop_ipv6_add(
|
||||||
re, &api_nh->gate.ipv6, re->vrf_id);
|
re, &api_nh->gate.ipv6, api_nh->vrf_id);
|
||||||
break;
|
break;
|
||||||
case NEXTHOP_TYPE_IPV6_IFINDEX:
|
case NEXTHOP_TYPE_IPV6_IFINDEX:
|
||||||
nexthop = route_entry_nexthop_ipv6_ifindex_add(
|
nexthop = route_entry_nexthop_ipv6_ifindex_add(
|
||||||
re, &api_nh->gate.ipv6, api_nh->ifindex,
|
re, &api_nh->gate.ipv6, api_nh->ifindex,
|
||||||
re->vrf_id);
|
api_nh->vrf_id);
|
||||||
break;
|
break;
|
||||||
case NEXTHOP_TYPE_BLACKHOLE:
|
case NEXTHOP_TYPE_BLACKHOLE:
|
||||||
nexthop = route_entry_nexthop_blackhole_add(
|
nexthop = route_entry_nexthop_blackhole_add(
|
||||||
|
Loading…
Reference in New Issue
Block a user