Skip to content

libtailscale: drop inet.af dependency, use net/netip #638

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

Merged
merged 1 commit into from
Apr 14, 2025
Merged

Conversation

raggi
Copy link
Member

@raggi raggi commented Apr 14, 2025

Move to the stdlib version, inet.af is bitrotting as a domain and implementation.

Updates #cleanup

Copy link

review-ai-agent bot commented Apr 14, 2025

Pull Request Revisions

RevisionDescription
r4
Network interface address parsing changedRefactored IP address parsing in getInterfaces() to use net.ParseCIDR() instead of netip.ParsePrefix()
r3No changes since last revision
r2
Removed unnecessary dependencies from mod filesCleaned up go.mod and go.sum by removing unused dependencies like inet.af/netaddr, go4.org/intern, and various historical package references
r1
Replaced netaddr with netip parsingMigrated IP address parsing from inet.af/netaddr to Go's standard netip package, updating IP prefix conversion logic
✅ AI review completed for r4
Help React with emojis to give feedback on AI-generated reviews:
  • 👍 means the feedback was helpful and actionable
  • 👎 means the feedback was incorrect or unhelpful
💬 Replying to feedback with a comment helps us improve the system. Your input also contributes to shaping future interactions with the AI reviewer.

We'd love to hear from you—reach out anytime at [email protected].

@raggi raggi force-pushed the raggi/no-inetaf branch 2 times, most recently from fd59cb0 to 2ef1f4b Compare April 14, 2025 20:25
@raggi raggi requested review from barnstar and kari-ts April 14, 2025 20:38
@@ -102,9 +101,12 @@ func (a *App) getInterfaces() ([]netmon.Interface, error) {

addrs := strings.Trim(fields[1], " \n")
for _, addr := range strings.Split(addrs, " ") {
ip, err := netaddr.ParseIPPrefix(addr)
ip, err := netip.ParsePrefix(addr)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: We could also net.ParseCIDR() since the goal is to get a *net.IPNet.

Move to the stdlib version, inet.af is bitrotting as a domain and
implementation.

Updates #cleanup

Signed-off-by: James Tucker <[email protected]>
@raggi raggi force-pushed the raggi/no-inetaf branch from 2ef1f4b to 280640a Compare April 14, 2025 20:45
@raggi raggi merged commit 9c933a0 into main Apr 14, 2025
5 checks passed
@raggi raggi deleted the raggi/no-inetaf branch April 14, 2025 20:51
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.

3 participants