From 473f5b6ff32be2829dac2a19bd63df19a7efd4ec Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Thu, 15 Oct 2015 21:10:50 +0900 Subject: table: fix to handle doReplace flag Signed-off-by: ISHIDA Wataru --- table/path.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'table/path.go') diff --git a/table/path.go b/table/path.go index 83e442c0..b45b7f68 100644 --- a/table/path.go +++ b/table/path.go @@ -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)) -- cgit v1.2.3