diff options
| author | Simon Rozman <simon@rozman.si> | 2023-03-23 10:23:18 +0100 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2023-09-25 09:43:37 +0200 |
| commit | 498b747669e97e8af414a369433c04371396f08c (patch) | |
| tree | 5829ff36ae8c46214fd651b77a98647250940575 /internal/failover/monitor.go | |
| parent | eb57e36d3c017bef80277e97db1009c38893ce2d (diff) | |
Fix connection monitoring on Windows
Linux requires su for `ip4:icmp` pings. Windows does not support `udp4`
pings.
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'internal/failover/monitor.go')
| -rw-r--r-- | internal/failover/monitor.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/failover/monitor.go b/internal/failover/monitor.go index f143f94..5dcaf5c 100644 --- a/internal/failover/monitor.go +++ b/internal/failover/monitor.go @@ -51,7 +51,7 @@ func (m *DroppedConMon) Start(gateway string, mtuSize int) (bool, error) { defer m.cancel() // Create a ping struct with our mtu size - p, err := NewPinger(mtuSize) + p, err := NewPinger(gateway, mtuSize) if err != nil { return false, err } @@ -64,7 +64,7 @@ func (m *DroppedConMon) Start(gateway string, mtuSize int) (bool, error) { // Send a ping and wait for max 2 seconds // If we have then increased Rx bytes we return early - if err = p.Send(gateway, 1); err != nil { + if err = p.Send(1); err != nil { log.Logger.Debugf("[Failover] First ping failed, exiting...") return false, err } @@ -90,7 +90,7 @@ func (m *DroppedConMon) Start(gateway string, mtuSize int) (bool, error) { for s := 2; s <= m.pDropped; s++ { log.Logger.Debugf("[Failover] Sending ping: %d, with size: %d", s, mtuSize) // Send a ping and return if an error occurs - if err := p.Send(gateway, s); err != nil { + if err := p.Send(s); err != nil { log.Logger.Debugf("[Failover] A ping failed, exiting...") return false, err } |
