Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mdns): macos: handle address reuse and fallback for no interfaces #1283

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

skrashevich
Copy link
Contributor

@skrashevich skrashevich commented Jul 28, 2024

Overview

This PR addresses the error ERR internal/homekit/homekit.go:128 > error="no interfaces for listen" on macOS when running the application without root privileges.

Problem

The mDNS client was failing to bind to network interfaces, resulting in the error mentioned above. This typically occurred when specific network interfaces were not available or the address was already in use.

Solution

  • Address Reuse Handling:

    • Added a check for the "address already in use" error, allowing the loop to continue and try other interfaces.
  • Fallback for No Interfaces:

    • Implemented a fallback mechanism to use the system's default network interface if specific interfaces are not available.

Impact

These changes ensure that the mDNS client can gracefully handle common networking issues on macOS, improving reliability when the application is run without root privileges.
Fixes #1225

@AlexxIT AlexxIT self-assigned this Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using go2rtc for HomeKit in MacOS Sonoma
2 participants