mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
table: use a local configured med/local-pref path-attr if exists
If a path is generated locally and it has a med/local-pref path attribute, don't remove or alter that. Signed-off-by: ISHIDA Wataru <[email protected]>
This commit is contained in:
committed by
FUJITA Tomonori
parent
b10be2ffd0
commit
2db916a4d3
+2
-2
@@ -96,7 +96,7 @@ func (path *Path) UpdatePathAttrs(global *config.Global, peer *config.Neighbor)
|
||||
|
||||
// MED Handling
|
||||
idx, _ := path.getPathAttr(bgp.BGP_ATTR_TYPE_MULTI_EXIT_DISC)
|
||||
if idx >= 0 {
|
||||
if idx >= 0 && !path.IsLocal() {
|
||||
path.pathAttrs = append(path.pathAttrs[:idx], path.pathAttrs[idx+1:]...)
|
||||
}
|
||||
} else if peer.NeighborConfig.PeerType == config.PEER_TYPE_INTERNAL {
|
||||
@@ -124,7 +124,7 @@ func (path *Path) UpdatePathAttrs(global *config.Global, peer *config.Neighbor)
|
||||
idx, _ = path.getPathAttr(bgp.BGP_ATTR_TYPE_LOCAL_PREF)
|
||||
if idx < 0 {
|
||||
path.pathAttrs = append(path.pathAttrs, p)
|
||||
} else {
|
||||
} else if !path.IsLocal() {
|
||||
path.pathAttrs[idx] = p
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user