From f087754400781ad970bc214f6326e7c7c65dc3f8 Mon Sep 17 00:00:00 2001 From: Oliver Herms <oliver.herms@exaring.de> Date: Tue, 29 May 2018 11:58:05 +0200 Subject: [PATCH] Fixing decoding of unknown attributes --- protocols/bgp/packet/path_attributes.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/protocols/bgp/packet/path_attributes.go b/protocols/bgp/packet/path_attributes.go index 0390b661..45451c5d 100644 --- a/protocols/bgp/packet/path_attributes.go +++ b/protocols/bgp/packet/path_attributes.go @@ -6,6 +6,7 @@ import ( "strconv" "strings" + "github.com/sirupsen/logrus" "github.com/taktv6/tflow2/convert" ) @@ -19,10 +20,11 @@ func decodePathAttrs(buf *bytes.Buffer, tpal uint16) (*PathAttribute, error) { p := uint16(0) for p < tpal { pa, consumed, err = decodePathAttr(buf) + p += consumed if err != nil { - return nil, fmt.Errorf("Unable to decode path attr: %v", err) + logrus.Errorf("Unable to decode path attr: %v", err) + continue } - p += consumed if ret == nil { ret = pa -- GitLab