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
8f80dc93
Commit
8f80dc93
authored
6 years ago
by
Oliver Herms
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/sendbuffer' of github.com:bio-routing/bio-rd into feature/sendbuffer
parents
37e28661
a7130cbf
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
route/bgp_path.go
+4
-4
4 additions, 4 deletions
route/bgp_path.go
routingtable/adjRIBOut/adj_rib_out.go
+25
-9
25 additions, 9 deletions
routingtable/adjRIBOut/adj_rib_out.go
with
29 additions
and
13 deletions
route/bgp_path.go
+
4
−
4
View file @
8f80dc93
...
...
@@ -251,15 +251,15 @@ func (b *BGPPath) Prepend(asn uint32, times uint16) {
b
.
ASPathLen
=
b
.
ASPath
.
Length
()
}
func
(
b
*
BGPPath
)
insertNewASSequence
()
types
.
ASPath
{
func
(
b
*
BGPPath
)
insertNewASSequence
()
{
pa
:=
make
(
types
.
ASPath
,
len
(
b
.
ASPath
)
+
1
)
copy
(
pa
[
1
:
],
b
.
ASPath
)
pa
[
0
]
=
types
.
ASPathSegment
{
ASNs
:
make
([]
uint32
,
0
),
Type
:
types
.
ASSequence
,
ASNs
:
make
([]
uint32
,
0
),
Type
:
packet
.
ASSequence
,
}
return
pa
b
.
ASPath
=
pa
}
// Copy creates a deep copy of a BGPPath
...
...
This diff is collapsed.
Click to expand it.
routingtable/adjRIBOut/adj_rib_out.go
+
25
−
9
View file @
8f80dc93
...
...
@@ -69,19 +69,21 @@ func (a *AdjRIBOut) AddPath(pfx bnet.Prefix, p *route.Path) error {
a
.
mu
.
Lock
()
defer
a
.
mu
.
Unlock
()
if
!
a
.
neighbor
.
CapAddPathRX
{
// AddPathRX capable neighbor
if
a
.
neighbor
.
CapAddPathRX
{
pathID
,
err
:=
a
.
pathIDManager
.
addPath
(
p
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"Unable to get path ID: %v"
,
err
)
}
p
.
BGPPath
.
PathIdentifier
=
pathID
a
.
rt
.
AddPath
(
pfx
,
p
)
}
else
{
// rt.ReplacePath will add this path to the rt in any case, so no rt.AddPath here!
oldPaths
:=
a
.
rt
.
ReplacePath
(
pfx
,
p
)
a
.
removePathsFromClients
(
pfx
,
oldPaths
)
}
pathID
,
err
:=
a
.
pathIDManager
.
addPath
(
p
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"Unable to get path ID: %v"
,
err
)
}
p
.
BGPPath
.
PathIdentifier
=
pathID
a
.
rt
.
AddPath
(
pfx
,
p
)
for
_
,
client
:=
range
a
.
ClientManager
.
Clients
()
{
err
:=
client
.
AddPath
(
pfx
,
p
)
if
err
!=
nil
{
...
...
@@ -166,3 +168,17 @@ func (a *AdjRIBOut) Print() string {
return
ret
}
// Dump all routes present in this AdjRIBOut
func
(
a
*
AdjRIBOut
)
Dump
()
string
{
a
.
mu
.
RLock
()
defer
a
.
mu
.
RUnlock
()
ret
:=
fmt
.
Sprintf
(
"DUMPING ADJ-RIB-OUT:
\n
"
)
routes
:=
a
.
rt
.
Dump
()
for
_
,
r
:=
range
routes
{
ret
+=
fmt
.
Sprintf
(
"%s
\n
"
,
r
.
Print
())
}
return
ret
}
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