feat(openvpn): explain ip route error in logs

- `RTNETLINK answers: File exists` changed to warning with explanation
- `Linux route add command failed:` changed to warning with explanation
This commit is contained in:
Quentin McGaw
2022-11-11 09:44:17 +00:00
parent 554a6cdb92
commit 7421dcb45f
2 changed files with 40 additions and 0 deletions

View File

@@ -65,6 +65,16 @@ That error usually happens because either:
filtered = s
level = levelInfo
}
switch {
case filtered == "RTNETLINK answers: File exists":
filtered = "OpenVPN tried to add an IP route which already exists (" + filtered + ")"
level = levelWarn
case strings.HasPrefix(filtered, "Linux route add command failed: "):
filtered = "Previous error details: " + filtered
level = levelWarn
}
filtered = constants.ColorOpenvpn().Sprintf(filtered)
return filtered, level
}