summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorWataru Ishida <ishida.wataru@lab.ntt.co.jp>2016-11-25 00:32:21 -0500
committerWataru Ishida <ishida.wataru@lab.ntt.co.jp>2016-11-25 00:32:21 -0500
commit08df3f31d910599ed8be3bf125e4204680178a2f (patch)
tree864909a9185c67052464eda01a84abe11fbfcda1 /server
parente566d55587d1efbbf93975db7ddbf060c86bd1cc (diff)
rpki: check asPath == nil before validation
locally generated routes may not have AS path attribute Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r--server/rpki.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/rpki.go b/server/rpki.go
index 7f771f27..3d54b8c0 100644
--- a/server/rpki.go
+++ b/server/rpki.go
@@ -493,7 +493,7 @@ func (c *roaManager) GetRoa(family bgp.RouteFamily) ([]*table.ROA, error) {
func validatePath(ownAs uint32, tree *radix.Tree, cidr string, asPath *bgp.PathAttributeAsPath) config.RpkiValidationResultType {
var as uint32
- if len(asPath.Value) == 0 {
+ if asPath == nil || len(asPath.Value) == 0 {
as = ownAs
} else {
asParam := asPath.Value[len(asPath.Value)-1].(*bgp.As4PathParam)