summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_attr.c6
-rw-r--r--bgpd/bgp_route.c7
-rw-r--r--bgpd/bgp_route.h6
-rw-r--r--bgpd/bgp_zebra.c4
4 files changed, 12 insertions, 11 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index 0870748f7e..fb97fea72d 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -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)
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 716ba26305..6039a91f7d 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -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;
diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h
index 72fcfe2466..75da2723e6 100644
--- a/bgpd/bgp_route.h
+++ b/bgpd/bgp_route.h
@@ -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);
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index fa290743c7..51763a0e1a 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -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);