Skip to content

Conversation

@wpyoga
Copy link
Contributor

@wpyoga wpyoga commented Dec 12, 2024

This fixes #61

What I've changed:

  • Swap out netifaces-plus with ifaddr.
  • Refactored _getNetworkAddrs to use ifaddr.

Reasons for using ifaddr:

  • The maintainer of netifaces-plus recommends ifaddr.
  • ifaddr is a pure python package.
  • ifaddr provides RFC4007 scope id as a number, while netifaces-plus provides the scope id as the interface name (on Linux). Therefore we can just use the number (actually, interface number), no need to convert back from interface name to interface number.

I've made a small test for comparison, here: https://github.com/wpyoga/python-ifaces-test

@wpyoga
Copy link
Contributor Author

wpyoga commented Dec 12, 2024

Commit adefa17 fixes a syntax issue in README -- instead of opening a separate PR, I figured I would just add the fix together with this PR. Please let me know if this is not allowed.

@andreikop andreikop merged commit 91b1514 into andreikop:master Dec 12, 2024
0 of 6 checks passed
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.

没有 IPv6 Scope ID 会导致异常

2 participants