-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Revamp UDP ports setting #1130
Merged
davidebeatrici
merged 7 commits into
SoftEtherVPN:master
from
davidebeatrici:common-udp-ports-setting
May 20, 2020
Merged
Revamp UDP ports setting #1130
davidebeatrici
merged 7 commits into
SoftEtherVPN:master
from
davidebeatrici:common-udp-ports-setting
May 20, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have to update |
Now that Proto supports UDP, the server can handle multiple protocols on each UDP port. The UDP ports are specified by the "OpenVPN_UdpPortList" configuration setting, because: - OpenVPN is currently the only UDP protocol supported by SoftEther VPN to allow a custom port number. - Before Proto was introduced, a unified interface for the protocols didn't exist; each protocol implementation had to create its own listener. In preparation for the upcoming WireGuard implementation, this commit renames "OpenVPN_UdpPortList" to "PortsUDP", which should clarify that the setting is global. The change is reflected in the code. Also, the ports are now stored in a LIST rather than a string. The conversion between string and LIST only happens when loading/saving the configuration. The default UDP ports are now the same as the TCP ones (443, 992, 1194, 5555).
6408614
to
545d96b
Compare
7abea8c
to
1437586
Compare
Originally, StrToPortList() returned NULL when it encountered a number equal to 0 or higher than 65535. This commit adds a new parameter to the function called "limit_range": - When its value is true, the function retains the original behavior. - When its value is false, the function doesn't check whether the number is in the network port number range (1-65535). The change is required because the command to set the UDP ports will allow to remove all ports by specifying "0" as the port number.
PortsUDPSet: This command can be used to specify a single or multiple UDP ports the server should listen on. "0" can be specified to disable the UDP listener. Administrator privileges are required to execute the command. PortsUDPGet: This command can be used to retrieve the UDP ports the server is listening on. The two commands replace the functionality that was previously provided by OpenVpnEnable and OpenVpnGet, respectively.
The function only called StrToPortList(), thus it can safely be replaced with the upstream function.
This commit moves the UDP ports setting right below the TCP listeners and uses the new RPC methods to get and set them.
1437586
to
f7f6eee
Compare
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Now that Proto supports UDP, the server can handle multiple protocols on each UDP port.
The UDP ports are specified by the
OpenVPN_UdpPortList
configuration setting, because:In preparation for the upcoming WireGuard implementation, this pull request renames
OpenVPN_UdpPortList
toPortsUDP
, which should clarify that the setting is global.The change is reflected in the code. Also, the ports are now stored in a
LIST
rather than a string. The conversion between string andLIST
only happens when loading/saving the configuration.The default UDP ports are now the same as the TCP ones (443, 992, 1194, 5555).
VPN Command Line Management Utility:
0
can be specified to disable the UDP listener.Administrator privileges are required to execute the command.
The two commands replace the functionality that was previously provided by
OpenVpnEnable
andOpenVpnGet
, respectively.VPN Server Manager: