summaryrefslogtreecommitdiffhomepage
path: root/table/path.go
diff options
context:
space:
mode:
Diffstat (limited to 'table/path.go')
-rw-r--r--table/path.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/table/path.go b/table/path.go
index 269f6129..b9362bd9 100644
--- a/table/path.go
+++ b/table/path.go
@@ -76,7 +76,12 @@ func NewPathDefault(rf RouteFamily, source *PeerInfo, nlri bgp.AddrPrefixInterfa
// create new PathAttributes
func (pd *PathDefault) Clone(isWithdraw bool) Path {
copiedAttrs := []bgp.PathAttributeInterface(nil)
- if !isWithdraw {
+ nlri := pd.nlri
+ if isWithdraw {
+ if !pd.IsWithdraw() {
+ nlri = &bgp.WithdrawnRoute{pd.nlri.(*bgp.NLRInfo).IPAddrPrefix}
+ }
+ } else {
copiedAttrs = append(copiedAttrs, pd.pathAttrs...)
for i, attr := range copiedAttrs {
t, v := reflect.TypeOf(attr), reflect.ValueOf(attr)
@@ -85,7 +90,7 @@ func (pd *PathDefault) Clone(isWithdraw bool) Path {
copiedAttrs[i] = newAttrObjp.Interface().(bgp.PathAttributeInterface)
}
}
- return CreatePath(pd.source, pd.nlri, copiedAttrs, isWithdraw)
+ return CreatePath(pd.source, nlri, copiedAttrs, isWithdraw)
}
func (pd *PathDefault) getRouteFamily() RouteFamily {