diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-31 01:03:57 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-31 01:03:57 +0900 |
commit | bb7f960572bba5ce1ddbded69e8315667e87d4c4 (patch) | |
tree | 1f8efc47ef0a7b513055320057d51489bbeb14e0 /table | |
parent | 8fd86716d0a53c3cc5e1b5b4367e908061aacabc (diff) |
table: fix 2byte AS peer helper functions
If AS_PATH attribute doesn't exist, just return.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table')
-rw-r--r-- | table/message.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/table/message.go b/table/message.go index dac7c439..0cfa07e8 100644 --- a/table/message.go +++ b/table/message.go @@ -29,6 +29,10 @@ func UpdatePathAttrs2ByteAs(msg *bgp.BGPUpdate) error { } } + if asAttr == nil { + return nil + } + as4pathParam := make([]*bgp.As4PathParam, 0) for i, param := range asAttr.Value { asParam, y := param.(*bgp.As4PathParam) @@ -74,6 +78,10 @@ func UpdatePathAttrs4ByteAs(msg *bgp.BGPUpdate) error { } } + if asAttr == nil { + return nil + } + AS := make([]uint32, 0) if as4Attr != nil { for _, p := range as4Attr.Value { |