Skip to content

Commit

Permalink
explicitly pass -4 flag to ping command to try ipv4 with ping command…
Browse files Browse the repository at this point in the history
… except for OS X clients, fixes #77
  • Loading branch information
highvolt-dev committed Feb 11, 2023
1 parent 84be2cb commit 938bb66
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tmo_monitor/gateway/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class ControllerBase:
# functions that don't touch the API
def ping(self, ping_host, ping_count, ping_interval, interface = None, ping_6 = False):
is_win = platform.system() == 'Windows'
is_mac = platform.system() == 'Darwin'

ping_cmd = []
extra_flags = []
Expand All @@ -21,6 +22,9 @@ def ping(self, ping_host, ping_count, ping_interval, interface = None, ping_6 =
ping_bin = 'ping6'
else:
extra_flags.append('-6')
# Explicitly use -4 flag for IPv4 except for Mac OS X
elif not is_mac:
extra_flags.append('-4')

# Add optional interface flag
if interface:
Expand Down

0 comments on commit 938bb66

Please sign in to comment.