From 3c1149deb80d98bbfba87fc5f7a391cc9239e0a6 Mon Sep 17 00:00:00 2001 From: Summer Yang Date: Mon, 9 Mar 2026 17:48:04 -0700 Subject: [PATCH] fix: verify macOS multicast route points to loopback interface The multicast configurator checked whether a 224.0.0.0/4 route existed but not which interface it was on. On macOS the route often exists on en0, causing cross-process LCM communication to fail silently. --- dimos/protocol/service/system_configurator/lcm.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dimos/protocol/service/system_configurator/lcm.py b/dimos/protocol/service/system_configurator/lcm.py index 0443ce5ccb..79bcf6671b 100644 --- a/dimos/protocol/service/system_configurator/lcm.py +++ b/dimos/protocol/service/system_configurator/lcm.py @@ -146,15 +146,20 @@ def __init__(self, loopback_interface: str = "lo0"): ] def check(self) -> bool: - # `netstat -nr` shows the routing table. We search for a 224/4 route entry. + # `netstat -nr` shows the routing table. We search for a 224/4 route entry + # that points to the loopback interface (lo0). The route often exists on + # en0 (WiFi/Ethernet), which causes cross-process LCM communication to fail. try: result = subprocess.run(["netstat", "-nr"], capture_output=True, text=True) if result.returncode != 0: print(f"ERROR: `netstat -nr` rc={result.returncode} stderr={result.stderr!r}") return False - route_ok = ("224.0.0.0/4" in result.stdout) or ("224.0.0/4" in result.stdout) - return bool(route_ok) + for line in result.stdout.splitlines(): + if "224.0.0.0/4" in line or "224.0.0/4" in line: + if self.loopback_interface in line: + return True + return False except Exception as error: print(f"ERROR: failed checking multicast route via netstat: {error}") return False