Skip to content
Snippets Groups Projects
Commit 052e6cd0 authored by Christoph Petrausch's avatar Christoph Petrausch
Browse files

Added logging for failing AddPath

parent 1aeb1e3e
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ import (
"github.com/bio-routing/bio-rd/net"
"github.com/bio-routing/bio-rd/route"
"github.com/bio-routing/bio-rd/routingtable"
log "github.com/sirupsen/logrus"
)
// AdjRIBIn represents an Adjacency RIB In as described in RFC4271
......@@ -33,7 +34,11 @@ func (a *AdjRIBIn) UpdateNewClient(client routingtable.RouteTableClient) error {
for _, route := range routes {
paths := route.Paths()
for _, path := range paths {
client.AddPath(route.Prefix(), path)
err := client.AddPath(route.Prefix(), path)
if err != nil {
log.WithField("Sender", "AdjRIBOutAddPath").WithError(err).Error("Could not send update to client")
}
}
}
return nil
......
......@@ -7,6 +7,7 @@ import (
"github.com/bio-routing/bio-rd/net"
"github.com/bio-routing/bio-rd/route"
"github.com/bio-routing/bio-rd/routingtable"
log "github.com/sirupsen/logrus"
)
// AdjRIBOut represents an Adjacency RIB In as described in RFC4271
......@@ -45,7 +46,10 @@ func (a *AdjRIBOut) AddPath(pfx net.Prefix, p *route.Path) error {
a.removePathsFromClients(pfx, oldPaths)
for _, client := range a.ClientManager.Clients() {
client.AddPath(pfx, p)
err := client.AddPath(pfx, p)
if err != nil {
log.WithField("Sender", "AdjRIBOut").WithError(err).Error("Could not send update to client")
}
}
return nil
}
......
......@@ -7,6 +7,7 @@ import (
"github.com/bio-routing/bio-rd/net"
"github.com/bio-routing/bio-rd/route"
"github.com/bio-routing/bio-rd/routingtable"
log "github.com/sirupsen/logrus"
)
// AdjRIBOutAddPath represents an Adjacency RIB Out with BGP add path
......@@ -52,7 +53,10 @@ func (a *AdjRIBOutAddPath) AddPath(pfx net.Prefix, p *route.Path) error {
a.rt.AddPath(pfx, p)
for _, client := range a.ClientManager.Clients() {
client.AddPath(pfx, p)
err := client.AddPath(pfx, p)
if err != nil {
log.WithField("Sender", "AdjRIBOutAddPath").WithError(err).Error("Could not send update to client")
}
}
return nil
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment