From 84be2cb980c48f79ed0942a022f3ff7184093f68 Mon Sep 17 00:00:00 2001 From: highvolt-dev Date: Sat, 11 Feb 2023 16:53:44 -0500 Subject: [PATCH 1/2] correct README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d87fb73..135ff90 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ Valid values are `NOK5G21` for the Nokia gateway, `ARCKVD21` for the square, bla ### Connectivity check **Mode:** `--connectivity-check` - Defaults to `ping`. Can instead use a HTTP(S) based health check with the `http` value. The `http` health check defaults to checking `https://google.com/generate_204` and checking its status code. _All connectivity checks will respect the `-I --interface` flag_. + Defaults to `ping`. Can instead use a HTTP(S) based health check with the `http` value. The `http` health check defaults to checking `https://google.com/generate_204` and checking its status code. **Interface:** `-I --interface` Can be used to specify the network interface used by the ping command. Useful if T-Mobile Home Internet is not your default network interface: e.g., this is running on a dual WAN router. On Windows, pass the source IP address to use. `http` connectivity checks will be dictated by system routing rules. From 938bb66901d5b2d2ef101caf8508c166df025c5a Mon Sep 17 00:00:00 2001 From: highvolt-dev Date: Sat, 11 Feb 2023 16:59:16 -0500 Subject: [PATCH 2/2] explicitly pass -4 flag to ping command to try ipv4 with ping command except for OS X clients, fixes #77 --- tmo_monitor/gateway/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tmo_monitor/gateway/base.py b/tmo_monitor/gateway/base.py index 0374f5b..fed2cb4 100644 --- a/tmo_monitor/gateway/base.py +++ b/tmo_monitor/gateway/base.py @@ -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 = [] @@ -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: