Skip to content

Conversation

lixmal
Copy link
Collaborator

@lixmal lixmal commented Oct 15, 2025

Describe your changes

This fixes an incompatibility between lazy connections and IP_UNICAST_IF sock opts on windows.

Issue ticket number and link

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__

@Copilot Copilot AI review requested due to automatic review settings October 15, 2025 14:03
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a bind activity listener to bypass UDP sockets and fix incompatibility issues between lazy connections and IP_UNICAST_IF socket options on Windows. The change introduces support for both UDP-based and bind-based activity detection depending on the WireGuard interface mode.

Key changes:

  • Adds support for bind-based activity listeners using LazyConn for userspace bind mode
  • Refactors existing UDP listener code into separate files for better organization
  • Updates interfaces to expose bind providers and WireGuard address information

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
client/internal/lazyconn/wgiface.go Adds Address() method to WGIface interface
client/internal/lazyconn/activity/manager.go Refactors to support both UDP and bind listeners with factory method
client/internal/lazyconn/activity/listener_udp.go Extracted UDP listener implementation from original listener.go
client/internal/lazyconn/activity/listener_bind.go New bind listener implementation using LazyConn for userspace mode
client/internal/lazyconn/activity/listener.go Simplified to factory function and interface definition
client/internal/lazyconn/activity/lazy_conn.go New LazyConn implementation for activity detection in bind mode
client/iface/*.go Adds GetICEBind() method to device interfaces across platforms

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@lixmal lixmal force-pushed the bind-activity-listener branch 2 times, most recently from 3fa39e6 to a991b19 Compare October 15, 2025 14:07
@lixmal lixmal force-pushed the bind-activity-listener branch from a991b19 to 5923cbe Compare October 15, 2025 14:10
Copy link

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.

1 participant