From e4fb787beeab82170e448fa2655a95087910380c Mon Sep 17 00:00:00 2001 From: Daniel Czerwonk <daniel@dan-nrw.de> Date: Tue, 26 Jun 2018 21:34:19 +0200 Subject: [PATCH] no error any more --- protocols/bgp/server/update_helper.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/protocols/bgp/server/update_helper.go b/protocols/bgp/server/update_helper.go index 50850cb6..1fe4fdba 100644 --- a/protocols/bgp/server/update_helper.go +++ b/protocols/bgp/server/update_helper.go @@ -34,17 +34,14 @@ func pathAttribues(p *route.Path) (*packet.PathAttribute, error) { nextHop.Next = localPref if p.BGPPath != nil { - err := addOptionalPathAttribues(p, localPref) - - if err != nil { - return nil, err - } + optionals := addOptionalPathAttribues(p, localPref) + optionals.Next = p.BGPPath.UnknownAttributes } return asPath, nil } -func addOptionalPathAttribues(p *route.Path, parent *packet.PathAttribute) error { +func addOptionalPathAttribues(p *route.Path, parent *packet.PathAttribute) *packet.PathAttribute { current := parent if len(p.BGPPath.Communities) > 0 { @@ -65,7 +62,7 @@ func addOptionalPathAttribues(p *route.Path, parent *packet.PathAttribute) error current = largeCommunities } - return nil + return current } type serializeAbleUpdate interface { -- GitLab