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
2c04f298
Commit
2c04f298
authored
6 years ago
by
Daniel Czerwonk
Browse files
Options
Downloads
Patches
Plain Diff
preperations to split options
parent
6ad74e74
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
protocols/bgp/server/fsm.go
+15
-0
15 additions, 0 deletions
protocols/bgp/server/fsm.go
protocols/bgp/server/fsm_open_sent.go
+9
-4
9 additions, 4 deletions
protocols/bgp/server/fsm_open_sent.go
protocols/bgp/server/server_test.go
+3
-3
3 additions, 3 deletions
protocols/bgp/server/server_test.go
with
27 additions
and
7 deletions
protocols/bgp/server/fsm.go
+
15
−
0
View file @
2c04f298
...
...
@@ -113,6 +113,21 @@ func newFSM2(peer *peer) *FSM {
return
f
}
func
(
fsm
*
FSM
)
addressFamily
(
afi
uint16
,
safi
uint8
)
*
fsmAddressFamily
{
if
safi
!=
packet
.
UnicastSAFI
{
return
nil
}
switch
afi
{
case
packet
.
IPv4AFI
:
return
fsm
.
ipv4Unicast
case
packet
.
IPv6AFI
:
return
fsm
.
ipv6Unicast
default
:
return
nil
}
}
func
(
fsm
*
FSM
)
start
()
{
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
fsm
.
connectionCancelFunc
=
cancel
...
...
This diff is collapsed.
Click to expand it.
protocols/bgp/server/fsm_open_sent.go
+
9
−
4
View file @
2c04f298
...
...
@@ -183,20 +183,25 @@ func (s *openSentState) processAddPathCapability(addPathCap packet.AddPathCapabi
return
}
f
:=
s
.
fsm
.
addressFamily
(
addPathCap
.
AFI
,
addPathCap
.
SAFI
)
if
f
==
nil
{
return
}
switch
addPathCap
.
SendReceive
{
case
packet
.
AddPathReceive
:
if
!
s
.
fsm
.
peer
.
addPathSend
.
BestOnly
{
if
!
f
.
addPathSend
.
BestOnly
{
s
.
fsm
.
options
.
AddPathRX
=
true
}
case
packet
.
AddPathSend
:
if
s
.
fsm
.
peer
.
addPathRecv
{
if
f
.
addPathRecv
{
s
.
fsm
.
options
.
AddPathRX
=
true
}
case
packet
.
AddPathSendReceive
:
if
!
s
.
fsm
.
peer
.
addPathSend
.
BestOnly
{
if
!
f
.
addPathSend
.
BestOnly
{
s
.
fsm
.
options
.
AddPathRX
=
true
}
if
s
.
fsm
.
peer
.
addPathRecv
{
if
f
.
addPathRecv
{
s
.
fsm
.
options
.
AddPathRX
=
true
}
}
...
...
This diff is collapsed.
Click to expand it.
protocols/bgp/server/server_test.go
+
3
−
3
View file @
2c04f298
...
...
@@ -38,13 +38,13 @@ func TestBgpServerPeerSnapshot(t *testing.T) {
KeepAlive
:
time
.
Second
*
30
,
Passive
:
true
,
RouterID
:
s
.
RouterID
(),
AddPathSend
:
routingtable
.
ClientOptions
{
MaxPaths
:
10
,
},
IPv4
:
&
config
.
AddressFamilyConfig
{
RIB
:
rib
,
ImportFilter
:
filter
.
NewDrainFilter
(),
ExportFilter
:
filter
.
NewAcceptAllFilter
(),
AddPathSend
:
routingtable
.
ClientOptions
{
MaxPaths
:
10
,
},
},
}
s
.
AddPeer
(
pc
)
...
...
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