Skip to content

Conversation

Aptimex
Copy link

@Aptimex Aptimex commented Aug 11, 2025

I maintain a project that uses wireguard-go as library code for userspace Wireguard functionality. My project had a need to modify some options and functionality of the low-level networking functionality that this library offers, but which is currently not exposed when used as a library import. Since that flexibility might be useful to other projects as well I'm submitting this PR for consideration.

This PR provides 3 changes:

  • Add a Stack() method that provides access to the private net.stack object
  • Add a Endpoint() method that provides access to the private net.endpoint object
  • Add a new CreateNetTUNwithOptions() function that is exactly the same as the CreateNetTUN() function except it allows arbitrary stack options to be passed in; CreateNetTUN() then calls the new function with the current default options, which avoids breaking any existing code.

Edit ~2 hours after initial PR: figured out a much cleaner way to expose stack options, updated this description to match the new commit.

@Aptimex
Copy link
Author

Aptimex commented Aug 14, 2025

Closing due to messy commit history and failed DCO checks, moved to #127

@Aptimex Aptimex closed this Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants