summaryrefslogtreecommitdiffhomepage
path: root/table
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-11-07 16:55:22 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-11-08 05:05:36 -0800
commit2db916a4d3e5783ae3ac68bb436722fea0bbe925 (patch)
tree6b85a243e7b8263de4ac690dc1e2f7cbb7c37395 /table
parentb10be2ffd034d0c5bf69c4224dc2288400fe8ea6 (diff)
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 <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table')
-rw-r--r--table/path.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/table/path.go b/table/path.go
index 5e914975..38c8443a 100644
--- a/table/path.go
+++ b/table/path.go
@@ -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
}