diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-09-28 18:35:39 -0700 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-09-28 18:35:39 -0700 |
commit | a042bb3bf8656cf50a8be6713a98fd8b947c2fc5 (patch) | |
tree | 1c7ab9a1748bafbc3954cf5e49c33f94397461e3 /table | |
parent | 8821d5c33b454a1b6ad5f8b4851669fb32e9f2f8 (diff) |
table: MP_UNREACH_NLRI shouldn't carry any other path attributes
RFC4760 says:
An UPDATE message that contains the MP_UNREACH_NLRI is not required to
carry any other path attributes.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table')
-rw-r--r-- | table/message.go | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/table/message.go b/table/message.go index 9a09d71f..07c15511 100644 --- a/table/message.go +++ b/table/message.go @@ -298,15 +298,7 @@ func createUpdateMsgFromPath(path *Path, msg *bgp.BGPMessage) *bgp.BGPMessage { } else { nlris = []bgp.AddrPrefixInterface{path.GetNlri()} } - - clonedAttrs := path.GetPathAttrs() - for i, a := range clonedAttrs { - if a.GetType() == bgp.BGP_ATTR_TYPE_MP_UNREACH_NLRI || a.GetType() == bgp.BGP_ATTR_TYPE_MP_REACH_NLRI { - clonedAttrs[i] = bgp.NewPathAttributeMpUnreachNLRI(nlris) - break - } - } - return bgp.NewBGPUpdateMessage(nil, clonedAttrs, nil) + return bgp.NewBGPUpdateMessage(nil, []bgp.PathAttributeInterface{bgp.NewPathAttributeMpUnreachNLRI(nlris)}, nil) } } else { if msg != nil { |