From 448c4368bcfa2bd709511142431788ce4918aa2f Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Fri, 26 Jul 2019 16:52:02 +0900 Subject: pkg/packet/bgp: fix PathAttributeAs4Path to accept empty AS_PATH Signed-off-by: FUJITA Tomonori --- pkg/packet/bgp/bgp.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkg/packet/bgp') diff --git a/pkg/packet/bgp/bgp.go b/pkg/packet/bgp/bgp.go index 4d899f24..a6e0fd15 100644 --- a/pkg/packet/bgp/bgp.go +++ b/pkg/packet/bgp/bgp.go @@ -11089,6 +11089,10 @@ func (p *PathAttributeAs4Path) DecodeFromBytes(data []byte, options ...*Marshall if err != nil { return err } + if p.Length == 0 { + // ibgp or something + return nil + } eCode := uint8(BGP_ERROR_UPDATE_MESSAGE_ERROR) eSubCode := uint8(BGP_ERROR_SUB_MALFORMED_ATTRIBUTE_LIST) isAs4, err := validateAsPathValueBytes(value) -- cgit v1.2.3