Skip to content

FreeBSD: Improve client's virtual network interface handling - #1859

Merged
davidebeatrici merged 6 commits into
SoftEtherVPN:masterfrom
metalefty:bsdunixvlan
Jun 1, 2023
Merged

FreeBSD: Improve client's virtual network interface handling#1859
davidebeatrici merged 6 commits into
SoftEtherVPN:masterfrom
metalefty:bsdunixvlan

Conversation

@metalefty

Copy link
Copy Markdown
Contributor

As a result of this PR, vpnclient functionality on FreeBSD has become more practical.

  • Don't hardcode prefix for UNIX virtual network interface
  • Make NicDelete work on FreeBSD
    • Virtual network interfaces are properly cleaned up when shutting down vpnclient
  • Make NIC state change (up/down) work on FreeBSD
    • Virtual network interface state is set to up when attempt to VPN server

Fixes: #1858

metalefty added 4 commits May 31, 2023 17:48
In contrast to Linux, FreeBSD's tap devices are still plumbed after fd
closed. The tap device must be destroyed in addition to closing fd
to delete virtual network interfaces used for VPN connection.

NicDelete command now works properly and virtual network interfaces used
by vpnclient are cleaned up when shutting down vpnclient.
The same trick also works on FreeBSD. There's no reason to limit it to
Linux.
Comment thread src/Cedar/VLanUnix.c Outdated
@metalefty

Copy link
Copy Markdown
Contributor Author

@davidebeatrici Addressed you review comments. Also added missing prototype declaration.

@davidebeatrici
davidebeatrici merged commit 0f689d9 into SoftEtherVPN:master Jun 1, 2023
@davidebeatrici

Copy link
Copy Markdown
Member

Thanks!

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.

FreeBSD: NicDelete is not working

3 participants