From 2db916a4d3e5783ae3ac68bb436722fea0bbe925 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Sat, 7 Nov 2015 16:55:22 +0900 Subject: 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 --- table/path.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'table/path.go') 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 } -- cgit v1.2.3