summaryrefslogtreecommitdiffhomepage
path: root/server/rpki.go
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2018-01-12 14:18:00 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-01-24 08:18:50 +0900
commit549b7037381ec51d0c5b9a0abbe8f73000fda70c (patch)
tree40ed8a74f1b75990071b79e363e331887e7db51e /server/rpki.go
parentb391322bcbf56d623ca0a6b667c026b92f1e9e4d (diff)
*: Use strconv.ParseUint instead of strconv.Atoi()
For the 32-bit platform compatibility. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'server/rpki.go')
-rw-r--r--server/rpki.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/rpki.go b/server/rpki.go
index b6aec254..8f286930 100644
--- a/server/rpki.go
+++ b/server/rpki.go
@@ -25,12 +25,13 @@ import (
"time"
"github.com/armon/go-radix"
+ log "github.com/sirupsen/logrus"
+ "golang.org/x/net/context"
+
"github.com/osrg/gobgp/config"
"github.com/osrg/gobgp/packet/bgp"
"github.com/osrg/gobgp/packet/rtr"
"github.com/osrg/gobgp/table"
- log "github.com/sirupsen/logrus"
- "golang.org/x/net/context"
)
const (
@@ -453,7 +454,9 @@ func (c *roaManager) GetServers() []*config.RpkiServer {
l = append(l, &config.RpkiServer{
Config: config.RpkiServerConfig{
Address: addr,
- Port: func() uint32 { p, _ := strconv.Atoi(port); return uint32(p) }(),
+ // Note: RpkiServerConfig.Port is uint32 type, but the TCP/UDP
+ // port is 16-bit length.
+ Port: func() uint32 { p, _ := strconv.ParseUint(port, 10, 16); return uint32(p) }(),
},
State: client.state,
})