Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bio-rd
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danet
bio-rd
Commits
979b20e1
Commit
979b20e1
authored
5 years ago
by
Oliver Herms
Browse files
Options
Downloads
Patches
Plain Diff
Fix BMP reconnect
parent
effb3887
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
protocols/bgp/server/bmp_router.go
+2
-0
2 additions, 0 deletions
protocols/bgp/server/bmp_router.go
protocols/bgp/server/bmp_server.go
+3
-2
3 additions, 2 deletions
protocols/bgp/server/bmp_server.go
with
5 additions
and
2 deletions
protocols/bgp/server/bmp_router.go
+
2
−
0
View file @
979b20e1
...
...
@@ -29,6 +29,7 @@ type Router struct {
reconnectTimeMin
int
reconnectTimeMax
int
reconnectTime
int
dialTimeout
time
.
Duration
reconnectTimer
*
time
.
Timer
vrfRegistry
*
vrf
.
VRFRegistry
neighborManager
*
neighborManager
...
...
@@ -69,6 +70,7 @@ func newRouter(addr net.IP, port uint16) *Router {
reconnectTimeMin
:
30
,
// Suggested by RFC 7854
reconnectTimeMax
:
720
,
// Suggested by RFC 7854
reconnectTimer
:
time
.
NewTimer
(
time
.
Duration
(
0
)),
dialTimeout
:
time
.
Second
*
5
,
vrfRegistry
:
vrf
.
NewVRFRegistry
(),
neighborManager
:
newNeighborManager
(),
logger
:
log
.
New
(),
...
...
This diff is collapsed.
Click to expand it.
protocols/bgp/server/bmp_server.go
+
3
−
2
View file @
979b20e1
...
...
@@ -56,7 +56,7 @@ func (b *BMPServer) AddRouter(addr net.IP, port uint16) {
go
func
(
r
*
Router
)
{
for
{
<-
r
.
reconnectTimer
.
C
c
,
err
:=
net
.
Dial
(
"tcp"
,
fmt
.
Sprintf
(
"%s:%d"
,
r
.
address
.
String
(),
r
.
port
))
c
,
err
:=
net
.
Dial
Timeout
(
"tcp"
,
fmt
.
Sprintf
(
"%s:%d"
,
r
.
address
.
String
(),
r
.
port
)
,
r
.
dialTimeout
)
if
err
!=
nil
{
log
.
Infof
(
"Unable to connect to BMP router: %v"
,
err
)
if
r
.
reconnectTime
==
0
{
...
...
@@ -68,7 +68,8 @@ func (b *BMPServer) AddRouter(addr net.IP, port uint16) {
continue
}
r
.
reconnectTime
=
0
r
.
reconnectTime
=
r
.
reconnectTimeMin
r
.
reconnectTimer
=
time
.
NewTimer
(
time
.
Second
*
time
.
Duration
(
r
.
reconnectTime
))
log
.
Infof
(
"Connected to %s"
,
r
.
address
.
String
())
r
.
serve
(
c
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment