diff options
Diffstat (limited to 'bgpd/bgp_route.c')
| -rw-r--r-- | bgpd/bgp_route.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index e932738cd4..a1a5068a7f 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -2506,8 +2506,16 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi, } else if (!ibgp_to_ibgp && !transparent && !CHECK_FLAG(from->af_flags[afi][safi], PEER_FLAG_REFLECTOR_CLIENT) && IN6_IS_ADDR_LINKLOCAL(&peer->nexthop.v6_local) && peer->shared_network && - (from == bgp->peer_self || peer->sort == BGP_PEER_EBGP)) - global_and_ll = true; + (from == bgp->peer_self || peer->sort == BGP_PEER_EBGP)) { + /* If an implementation intends to send a single link-local forwarding + * address in the Next Hop field of the MP_REACH_NLRI, it MUST set the + * length of the Next Hop field to 16 and include only the IPv6 link-local + * address in the Next Hop field. + */ + if (!(CHECK_FLAG(peer->cap, PEER_CAP_LINK_LOCAL_ADV) && + CHECK_FLAG(peer->cap, PEER_CAP_LINK_LOCAL_RCV))) + global_and_ll = true; + } if (global_and_ll) { if (safi == SAFI_MPLS_VPN) @@ -2851,8 +2859,17 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi, * If the extended community is non-transitive, strip it off, * unless it's a locally originated route (static, aggregate, * redistributed, etc.). + * draft-uttaro-idr-bgp-oad says: + * Extended communities which are non-transitive across an AS + * boundary MAY be advertised over an EBGP-OAD session if allowed + * by explicit policy configuration. If allowed, all the members + * of the OAD SHOULD be configured to use the same criteria. + * For example, the Origin Validation State Extended Community, + * defined as non-transitive in [RFC8097], can be advertised to + * peers in the same OAD. */ - if (from->sort == BGP_PEER_EBGP && peer->sort == BGP_PEER_EBGP && + if (from->sort == BGP_PEER_EBGP && from->sub_sort != BGP_PEER_EBGP_OAD && + peer->sort == BGP_PEER_EBGP && peer->sub_sort != BGP_PEER_EBGP_OAD && pi->sub_type == BGP_ROUTE_NORMAL) { struct ecommunity *new_ecomm; struct ecommunity *old_ecomm; @@ -4120,6 +4137,9 @@ static void process_eoiu_marker(struct bgp_dest *dest) subqueue2str(META_QUEUE_EOIU_MARKER)); bgp_process_main_one(info->bgp, NULL, 0, 0); + + XFREE(MTYPE_BGP_EOIU_MARKER_INFO, info); + XFREE(MTYPE_BGP_NODE, dest); } /* @@ -4310,6 +4330,7 @@ static void eoiu_marker_queue_free(struct meta_queue *mq, struct bgp_dest_queue XFREE(MTYPE_BGP_EOIU_MARKER_INFO, dest->info); STAILQ_REMOVE_HEAD(l, pq); STAILQ_NEXT(dest, pq) = NULL; /* complete unlink */ + XFREE(MTYPE_BGP_NODE, dest); mq->size--; } } @@ -9933,6 +9954,7 @@ void route_vty_out(struct vty *vty, const struct prefix *p, "ipv6"); json_object_string_add(json_nexthop_global, "scope", "global"); + json_object_int_add(json_nexthop_global, "length", attr->mp_nexthop_len); /* We display both LL & GL if both have been * received */ @@ -9956,6 +9978,8 @@ void route_vty_out(struct vty *vty, const struct prefix *p, "ipv6"); json_object_string_add(json_nexthop_ll, "scope", "link-local"); + json_object_int_add(json_nexthop_global, "length", + attr->mp_nexthop_len); if ((IPV6_ADDR_CMP(&attr->mp_nexthop_global, &attr->mp_nexthop_local) != @@ -11077,6 +11101,7 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct bgp_dest *bn, "ipv6"); json_object_string_add(json_nexthop_global, "scope", "global"); + json_object_int_add(json_nexthop_global, "length", attr->mp_nexthop_len); } else { if (nexthop_hostname) vty_out(vty, " %pI6(%s)", @@ -11264,6 +11289,7 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct bgp_dest *bn, json_object_string_add(json_nexthop_ll, "afi", "ipv6"); json_object_string_add(json_nexthop_ll, "scope", "link-local"); + json_object_int_add(json_nexthop_ll, "length", attr->mp_nexthop_len); json_object_boolean_true_add(json_nexthop_ll, "accessible"); |
