diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-10-15 21:10:50 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-10-20 10:33:09 +0900 |
commit | 473f5b6ff32be2829dac2a19bd63df19a7efd4ec (patch) | |
tree | 2d042db0fa090d8c6667f2870ac00bf8010d3e07 /table/path.go | |
parent | 804126b0ac1c8aae7257d258e2125de16b20b22c (diff) |
table: fix to handle doReplace flag
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/path.go')
-rw-r--r-- | table/path.go | 6 |
1 files changed, 5 insertions, 1 deletions
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)) |