summaryrefslogtreecommitdiffhomepage
path: root/pkg/packet/bgp/bgp.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@gmail.com>2019-07-26 16:52:02 +0900
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2019-07-26 16:52:02 +0900
commit448c4368bcfa2bd709511142431788ce4918aa2f (patch)
treee68bd4adc1fb33b855512c76412bd0af66b73c9b /pkg/packet/bgp/bgp.go
parent9e775f56dc99d36aa5bf0e6fe0074945889b0166 (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/bgp/bgp.go')
-rw-r--r--pkg/packet/bgp/bgp.go4
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)