Merge pull request #2670 from ton31337/feature/use_med_if_applied_for_default_route

Use metric for default-originate with route-map if applied
This commit is contained in:
Russ White 2018-07-23 17:04:48 -04:00 committed by GitHub
commit 4dbfa73b17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -690,6 +690,7 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw)
aspath = attr.aspath;
attr.local_pref = bgp->default_local_pref;
attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC);
memset(&p, 0, sizeof(p));
p.family = afi2family(afi);
@ -724,6 +725,8 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw)
peer->default_rmap[afi][safi].map,
&rn->p, RMAP_BGP, &info);
attr.med = info.attr->med;
/* The route map might have set attributes. If
* we don't flush them
* here, they will be leaked. */