mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
table: fix to handle doReplace flag
Signed-off-by: ISHIDA Wataru <[email protected]>
This commit is contained in:
committed by
FUJITA Tomonori
parent
804126b0ac
commit
473f5b6ff3
+5
-1
@@ -569,7 +569,11 @@ func (path *Path) SetExtCommunities(values []byte, doReplace bool) {
|
||||
idx, attr := path.getPathAttr(bgp.BGP_ATTR_TYPE_EXTENDED_COMMUNITIES)
|
||||
if attr != nil {
|
||||
l := attr.(*bgp.PathAttributeExtendedCommunities).Value
|
||||
l = append(l, exts...)
|
||||
if doReplace {
|
||||
l = exts
|
||||
} else {
|
||||
l = append(l, exts...)
|
||||
}
|
||||
path.pathAttrs[idx] = bgp.NewPathAttributeExtendedCommunities(l)
|
||||
} else {
|
||||
path.pathAttrs = append(path.pathAttrs, bgp.NewPathAttributeExtendedCommunities(exts))
|
||||
|
||||
Reference in New Issue
Block a user