homebridge / HAP-NodeJS

Node.js implementation of the HomeKit Accessory Protocol (HAP)
Apache License 2.0
2.68k stars 630 forks source link

Cleanup and refactor getLocalNetworkInterface and address a potential edge case. #1056

Closed hjdhjd closed 2 months ago

hjdhjd commented 2 months ago

:recycle: Current situation

This is primarily a cleanup / update of getLocalNetworkInterface that does the following:

  1. Cleanup the logic a bit and use modern JS/TS semantics.
  2. Address an edge case reported by @donavanbecker that is currently impacting beta versions of macOS related to strange forms of IPv4-mapped IPv6 addresses that can occur.

:bulb: Proposed solution

Describe the proposed solution and changes. How does it affect the project? How does it affect the internal structure (e.g., refactorings)?

:gear: Release Notes

Modernize getLocalNetworkInterface and address edge cases.

:heavy_plus_sign: Additional Information

If applicable, provide additional context in this section.

Testing

Reviewer Nudging

@donavanbecker