diff --git a/cmd/app/main.go b/cmd/app/main.go index ccc4245..f750535 100644 --- a/cmd/app/main.go +++ b/cmd/app/main.go @@ -22,7 +22,7 @@ var envRequired = []string{ } var envDefaults = map[string]string{ "INTERFACE": "wg0", - //"MANAGE_ALL": "true", + // "MANAGE_ALL": "true", "FILTER_PROTOCOL": "-1", "FILTER_TABLE": "-1", @@ -39,7 +39,7 @@ func main() { envChecks.HandleDefaults(envDefaults) iface := os.Getenv("INTERFACE") - //MANAGE_ALL = os.Getenv("MANAGE_ALL") + // MANAGE_ALL = os.Getenv("MANAGE_ALL") // Check if ip2Map has init-errors for _, err := range ip2Map.Errors { @@ -91,7 +91,10 @@ func main() { // Subscribe to route-change events routeSubChan, routeSubDoneChan := make(chan netlink.RouteUpdate), make(chan struct{}) - netlink.RouteSubscribe(routeSubChan, routeSubDoneChan) + err = netlink.RouteSubscribe(routeSubChan, routeSubDoneChan) + if err != nil { + logger.Error.Fatalf("Couldn't subscribe to route-changes: %s", err) + } go handleRouteEvents(routeSubChan, filterOptions, iface) //# Initial Route-setup diff --git a/lib/iproute2mapping/mapping.go b/lib/iproute2mapping/mapping.go index 781cd39..2af4edb 100644 --- a/lib/iproute2mapping/mapping.go +++ b/lib/iproute2mapping/mapping.go @@ -33,7 +33,7 @@ func init() { ByName[mapType], ById[mapType], err = readFromFile(filePath) if err != nil { Errors = append(Errors, - fmt.Errorf("failed reading mapping-file '%s': %s", filePath, err), + fmt.Errorf("failed reading mapping-file '%s': %w", filePath, err), ) } } @@ -63,7 +63,7 @@ func readFromFile(filePath string) (mapByName map[string]int, mapById map[int]st if err != nil { // Only warn as we can continue processing the file Errors = append(Errors, - fmt.Errorf("mappig-data invalid '%s': %s", text, err), + fmt.Errorf("mappig-data invalid '%s': %w", text, err), ) continue }