Cleanup and speedup network convergence along with direct messaging for connect and solicit

This commit is contained in:
Asim Aslam
2019-12-07 19:54:29 +00:00
parent 1d8c66780e
commit c445aed6b1
17 changed files with 494 additions and 199 deletions

View File

@@ -799,7 +799,8 @@ func (r *router) flushRouteEvents(evType EventType) ([]*Event, error) {
// build a list of events to advertise
events := make([]*Event, len(bestRoutes))
i := 0
var i int
for _, route := range bestRoutes {
event := &Event{
Type: evType,
@@ -823,9 +824,10 @@ func (r *router) Solicit() error {
// advertise the routes
r.advertWg.Add(1)
go func() {
defer r.advertWg.Done()
r.publishAdvert(RouteUpdate, events)
r.publishAdvert(Solicitation, events)
r.advertWg.Done()
}()
return nil

View File

@@ -111,6 +111,8 @@ const (
Announce AdvertType = iota
// RouteUpdate advertises route updates
RouteUpdate
// Solicitation indicates routes were solicited
Solicitation
)
// String returns human readable advertisement type
@@ -120,6 +122,8 @@ func (t AdvertType) String() string {
return "announce"
case RouteUpdate:
return "update"
case Solicitation:
return "solicitation"
default:
return "unknown"
}