Move setting all routes to own func

This commit is contained in:
Ruakij 2023-03-30 12:31:22 +02:00
parent d5886fcb4a
commit 56b47e8fb6

View File

@ -93,6 +93,13 @@ func main() {
}
logger.Info.Printf("Initially setting all current routes")
syncCurrentRoutesToHandler(routeSubChan, routeList)
select {}
}
func syncCurrentRoutesToHandler(routeSubChan chan netlink.RouteUpdate, routeList []netlink.Route){
for _, route := range routeList {
// Ignore routes with empty gateway
if(route.Gw == nil){
@ -105,8 +112,6 @@ func main() {
Route: route,
}
}
select {}
}
var routeUpdateTypeMapFromId = map[uint16]string{