diff options
author | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-07-26 16:52:02 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-07-26 16:52:02 +0900 |
commit | 448c4368bcfa2bd709511142431788ce4918aa2f (patch) | |
tree | e68bd4adc1fb33b855512c76412bd0af66b73c9b /pkg/packet | |
parent | 9e775f56dc99d36aa5bf0e6fe0074945889b0166 (diff) |
pkg/packet/bgp: fix PathAttributeAs4Path to accept empty AS_PATH
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Diffstat (limited to 'pkg/packet')
-rw-r--r-- | pkg/packet/bgp/bgp.go | 4 |
1 files changed, 4 insertions, 0 deletions
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) |