Merge pull request #9324 from donaldsharp/bgp_info_cmp

bgpd: Store distance received from a redistribute statement
This commit is contained in:
Donatas Abraitis 2021-08-09 10:36:43 +03:00 committed by GitHub
commit d04e7788c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 11 deletions

View File

@ -789,9 +789,9 @@ static void attr_show_all_iterator(struct hash_bucket *bucket, struct vty *vty)
inet_ntop(AF_INET6, &attr->srv6_vpn->sid, sid_str, BUFSIZ);
vty_out(vty,
"\tflags: %" PRIu64" med: %u local_pref: %u origin: %u weight: %u label: %u sid: %s\n",
attr->flag, attr->med, attr->local_pref, attr->origin,
attr->weight, attr->label, sid_str);
"\tflags: %" PRIu64" distance: %u med: %u local_pref: %u origin: %u weight: %u label: %u sid: %s\n",
attr->flag, attr->distance, attr->med, attr->local_pref,
attr->origin, attr->weight, attr->label, sid_str);
}
void attr_show_all(struct vty *vty)

View File

@ -8063,9 +8063,9 @@ DEFPY(aggregate_addressv6, aggregate_addressv6_cmd,
/* Redistribute route treatment. */
void bgp_redistribute_add(struct bgp *bgp, struct prefix *p,
const union g_addr *nexthop, ifindex_t ifindex,
enum nexthop_types_t nhtype, uint32_t metric,
uint8_t type, unsigned short instance,
route_tag_t tag)
enum nexthop_types_t nhtype, uint8_t distance,
uint32_t metric, uint8_t type,
unsigned short instance, route_tag_t tag)
{
struct bgp_path_info *new;
struct bgp_path_info *bpi;
@ -8112,6 +8112,7 @@ void bgp_redistribute_add(struct bgp *bgp, struct prefix *p,
attr.nh_ifindex = ifindex;
attr.med = metric;
attr.distance = distance;
attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC);
attr.tag = tag;

View File

@ -641,9 +641,9 @@ extern bool bgp_maximum_prefix_overflow(struct peer *, afi_t, safi_t, int);
extern void bgp_redistribute_add(struct bgp *bgp, struct prefix *p,
const union g_addr *nexthop, ifindex_t ifindex,
enum nexthop_types_t nhtype, uint32_t metric,
uint8_t type, unsigned short instance,
route_tag_t tag);
enum nexthop_types_t nhtype, uint8_t distance,
uint32_t metric, uint8_t type,
unsigned short instance, route_tag_t tag);
extern void bgp_redistribute_delete(struct bgp *, struct prefix *, uint8_t,
unsigned short);
extern void bgp_redistribute_withdraw(struct bgp *, afi_t, int, unsigned short);

View File

@ -517,8 +517,8 @@ static int zebra_read_route(ZAPI_CALLBACK_ARGS)
/* Now perform the add/update. */
bgp_redistribute_add(bgp, &api.prefix, &nexthop, ifindex,
nhtype, api.metric, api.type, api.instance,
api.tag);
nhtype, api.distance, api.metric, api.type,
api.instance, api.tag);
} else {
bgp_redistribute_delete(bgp, &api.prefix, api.type,
api.instance);