split systemops for operating systems and add linux

This commit is contained in:
Pascal Fischer 2023-06-09 18:48:21 +02:00
parent dad5501a44
commit c8b4c08139

View File

@ -55,11 +55,15 @@ func getExistingRIBRouteGateway(prefix netip.Prefix) (net.IP, error) {
if err != nil {
return nil, err
}
_, gateway, _, err := r.Route(prefix.Addr().AsSlice())
_, gateway, preferredSrc, err := r.Route(prefix.Addr().AsSlice())
if err != nil {
log.Errorf("getting routes returned an error: %v", err)
return nil, errRouteNotFound
}
if gateway == nil {
return preferredSrc, nil
}
return gateway, nil
}