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
8522e20c
Commit
8522e20c
authored
6 years ago
by
Maximilian Wilhelm
Browse files
Options
Downloads
Patches
Plain Diff
Set OriginatorID and ClusterList for route reflector clients if required.
Signed-off-by:
Maximilian Wilhelm
<
max@sdn.clinic
>
parent
7ee75ef7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
routingtable/adjRIBOut/adj_rib_out.go
+23
-2
23 additions, 2 deletions
routingtable/adjRIBOut/adj_rib_out.go
with
23 additions
and
2 deletions
routingtable/adjRIBOut/adj_rib_out.go
+
23
−
2
View file @
8522e20c
...
@@ -53,8 +53,8 @@ func (a *AdjRIBOut) AddPath(pfx bnet.Prefix, p *route.Path) error {
...
@@ -53,8 +53,8 @@ func (a *AdjRIBOut) AddPath(pfx bnet.Prefix, p *route.Path) error {
return
nil
return
nil
}
}
// Don't export routes learned via iBGP to an iBGP neighbor
// Don't export routes learned via iBGP to an iBGP neighbor
which is NOT a route reflection client
if
!
p
.
BGPPath
.
EBGP
&&
a
.
neighbor
.
IBGP
{
if
!
p
.
BGPPath
.
EBGP
&&
a
.
neighbor
.
IBGP
&&
!
a
.
neighbor
.
RouteReflectorClient
{
return
nil
return
nil
}
}
...
@@ -65,6 +65,27 @@ func (a *AdjRIBOut) AddPath(pfx bnet.Prefix, p *route.Path) error {
...
@@ -65,6 +65,27 @@ func (a *AdjRIBOut) AddPath(pfx bnet.Prefix, p *route.Path) error {
p
.
BGPPath
.
NextHop
=
a
.
neighbor
.
LocalAddress
p
.
BGPPath
.
NextHop
=
a
.
neighbor
.
LocalAddress
}
}
// If the iBGP neighbor is a route reflection client...
if
a
.
neighbor
.
IBGP
&&
a
.
neighbor
.
RouteReflectorClient
{
/*
* RFC4456 Section 8:
* This attribute will carry the BGP Identifier of the originator of the route in the local AS.
* A BGP speaker SHOULD NOT create an ORIGINATOR_ID attribute if one already exists.
*/
if
p
.
BGPPath
.
OriginatorID
==
0
{
p
.
BGPPath
.
OriginatorID
=
p
.
BGPPath
.
Source
.
ToUint32
()
}
/*
* When an RR reflects a route, it MUST prepend the local CLUSTER_ID to the CLUSTER_LIST.
* If the CLUSTER_LIST is empty, it MUST create a new one.
*/
cList
:=
make
([]
uint32
,
len
(
p
.
BGPPath
.
ClusterList
)
+
1
)
copy
(
cList
[
1
:
],
p
.
BGPPath
.
ClusterList
)
cList
[
0
]
=
a
.
neighbor
.
ClusterID
p
.
BGPPath
.
ClusterList
=
cList
}
p
,
reject
:=
a
.
exportFilter
.
ProcessTerms
(
pfx
,
p
)
p
,
reject
:=
a
.
exportFilter
.
ProcessTerms
(
pfx
,
p
)
if
reject
{
if
reject
{
return
nil
return
nil
...
...
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