table: fix to handle doReplace flag

Signed-off-by: ISHIDA Wataru <[email protected]>
This commit is contained in:
ISHIDA Wataru
2015-10-20 10:33:09 +09:00
committed by FUJITA Tomonori
parent 804126b0ac
commit 473f5b6ff3
+5 -1
View File
@@ -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))