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 | |
parent | e637c746e9bc880b86ee11b06c306e533003598d (diff) |
server: Remove the wrong and verbose return value in validatePath()
-rw-r--r-- | server/rpki.go | 10 | ||||
-rw-r--r-- | server/rpki_test.go | 2 |
2 files changed, 6 insertions, 6 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) } } diff --git a/server/rpki_test.go b/server/rpki_test.go index 694883e7..c7c24669 100644 --- a/server/rpki_test.go +++ b/server/rpki_test.go @@ -57,7 +57,7 @@ func strToASParam(str string) *bgp.PathAttributeAsPath { } func validateOne(tree *radix.Tree, cidr, aspathStr string) config.RpkiValidationResultType { - r, _ := ValidatePath(65500, tree, cidr, strToASParam(aspathStr)) + r := ValidatePath(65500, tree, cidr, strToASParam(aspathStr)) return r.Status } |