diff options
Diffstat (limited to 'table/message.go')
-rw-r--r-- | table/message.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/table/message.go b/table/message.go index 97ec3b16..ee31f18d 100644 --- a/table/message.go +++ b/table/message.go @@ -160,8 +160,15 @@ func createUpdateMsgFromPath(path *Path, msg *bgp.BGPMessage) *bgp.BGPMessage { } else { clonedAttrs := cloneAttrSlice(path.GetPathAttrs()) idx, attr := path.getPathAttr(bgp.BGP_ATTR_TYPE_MP_REACH_NLRI) - reach := attr.(*bgp.PathAttributeMpReachNLRI) - clonedAttrs[idx] = bgp.NewPathAttributeMpUnreachNLRI(reach.Value) + if attr == nil { + // for bmp post-policy + idx, attr := path.getPathAttr(bgp.BGP_ATTR_TYPE_MP_UNREACH_NLRI) + reach := attr.(*bgp.PathAttributeMpUnreachNLRI) + clonedAttrs[idx] = bgp.NewPathAttributeMpUnreachNLRI(reach.Value) + } else { + reach := attr.(*bgp.PathAttributeMpReachNLRI) + clonedAttrs[idx] = bgp.NewPathAttributeMpUnreachNLRI(reach.Value) + } return bgp.NewBGPUpdateMessage(nil, clonedAttrs, nil) } } else { |