diff options
author | Eiichiro Watanabe <a16tochjp@gmail.com> | 2017-09-30 16:16:34 +0900 |
---|---|---|
committer | Eiichiro Watanabe <a16tochjp@gmail.com> | 2017-09-30 16:16:34 +0900 |
commit | 043d0d9530bc0e504ab93cfeb1b96d6b835e9054 (patch) | |
tree | df930d8e581a0242483245e8c3c2352ae9faf85f /server/rpki.go | |
parent | e637c746e9bc880b86ee11b06c306e533003598d (diff) |
server: Remove the wrong and verbose return value in validatePath()
Diffstat (limited to 'server/rpki.go')
-rw-r--r-- | server/rpki.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/rpki.go b/server/rpki.go index 8bc6462e..008b7d1f 100644 --- a/server/rpki.go +++ b/server/rpki.go @@ -497,7 +497,7 @@ func (c *roaManager) GetRoa(family bgp.RouteFamily) ([]*table.ROA, error) { return l, nil } -func ValidatePath(ownAs uint32, tree *radix.Tree, cidr string, asPath *bgp.PathAttributeAsPath) (*table.Validation, *RoaBucket) { +func ValidatePath(ownAs uint32, tree *radix.Tree, cidr string, asPath *bgp.PathAttributeAsPath) *table.Validation { var as uint32 validation := &table.Validation{ @@ -522,7 +522,7 @@ func ValidatePath(ownAs uint32, tree *radix.Tree, cidr string, asPath *bgp.PathA case bgp.BGP_ASPATH_ATTR_TYPE_CONFED_SET, bgp.BGP_ASPATH_ATTR_TYPE_CONFED_SEQ: as = ownAs default: - return validation, nil + return validation } } _, n, _ := net.ParseCIDR(cidr) @@ -531,7 +531,7 @@ func ValidatePath(ownAs uint32, tree *radix.Tree, cidr string, asPath *bgp.PathA key := table.IpToRadixkey(n.IP, prefixLen) _, b, _ := tree.LongestPrefix(key) if b == nil { - return validation, nil + return validation } var bucket *RoaBucket @@ -566,7 +566,7 @@ func ValidatePath(ownAs uint32, tree *radix.Tree, cidr string, asPath *bgp.PathA validation.Reason = table.RPKI_VALIDATION_REASON_TYPE_NONE } - return validation, bucket + return validation } func (c *roaManager) validate(pathList []*table.Path) { @@ -580,7 +580,7 @@ func (c *roaManager) validate(pathList []*table.Path) { continue } if tree, ok := c.Roas[path.GetRouteFamily()]; ok { - v, _ := ValidatePath(c.AS, tree, path.GetNlri().String(), path.GetAsPath()) + v := ValidatePath(c.AS, tree, path.GetNlri().String(), path.GetAsPath()) path.SetValidation(v) } } |