mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-17 19:05:44 +00:00
Merge pull request #12584 from pguibert6WIND/bgp_imported_distance
bgpd: imported vpn entries get appropriate distance
This commit is contained in:
commit
e2fd75fce2
@ -15012,6 +15012,7 @@ uint8_t bgp_distance_apply(const struct prefix *p, struct bgp_path_info *pinfo,
|
|||||||
struct bgp_distance *bdistance;
|
struct bgp_distance *bdistance;
|
||||||
struct access_list *alist;
|
struct access_list *alist;
|
||||||
struct bgp_static *bgp_static;
|
struct bgp_static *bgp_static;
|
||||||
|
struct bgp_path_info *bpi_ultimate;
|
||||||
|
|
||||||
if (!bgp)
|
if (!bgp)
|
||||||
return 0;
|
return 0;
|
||||||
@ -15021,6 +15022,12 @@ uint8_t bgp_distance_apply(const struct prefix *p, struct bgp_path_info *pinfo,
|
|||||||
if (pinfo->attr->distance)
|
if (pinfo->attr->distance)
|
||||||
return pinfo->attr->distance;
|
return pinfo->attr->distance;
|
||||||
|
|
||||||
|
/* get peer origin to calculate appropriate distance */
|
||||||
|
if (pinfo->sub_type == BGP_ROUTE_IMPORTED) {
|
||||||
|
bpi_ultimate = bgp_get_imported_bpi_ultimate(pinfo);
|
||||||
|
peer = bpi_ultimate->peer;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check source address.
|
/* Check source address.
|
||||||
* Note: for aggregate route, peer can have unspec af type.
|
* Note: for aggregate route, peer can have unspec af type.
|
||||||
*/
|
*/
|
||||||
|
@ -14,6 +14,7 @@ router bgp 65500 vrf vrf1
|
|||||||
bgp router-id 192.0.2.1
|
bgp router-id 192.0.2.1
|
||||||
address-family ipv4 unicast
|
address-family ipv4 unicast
|
||||||
redistribute connected
|
redistribute connected
|
||||||
|
distance bgp 21 201 41
|
||||||
label vpn export 101
|
label vpn export 101
|
||||||
rd vpn export 444:1
|
rd vpn export 444:1
|
||||||
rt vpn both 52:100
|
rt vpn both 52:100
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
"vrfName": "vrf1",
|
"vrfName": "vrf1",
|
||||||
"selected": true,
|
"selected": true,
|
||||||
"destSelected": true,
|
"destSelected": true,
|
||||||
"distance": 20,
|
"distance": 201,
|
||||||
"metric": 0,
|
"metric": 0,
|
||||||
"nexthops": [
|
"nexthops": [
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user