diff --git a/src/BuildFiles/VerScript/ver.rc b/src/BuildFiles/VerScript/ver.rc index 1d937b5e..a14c3b14 100644 --- a/src/BuildFiles/VerScript/ver.rc +++ b/src/BuildFiles/VerScript/ver.rc @@ -12,8 +12,8 @@ BEGIN BEGIN BLOCK "041104b0" BEGIN - VALUE "CompanyName", "SoftEther VPN Project at University of Tsukuba, Japan. (Open-source Customized Build)" - VALUE "FileDescription", "$PRODUCTNAME$ (Open-source Customized Build)" + VALUE "CompanyName", "SoftEther VPN Project (Milok Zbrozek custom build)" + VALUE "FileDescription", "$PRODUCTNAME$ (Milok Zbrozek Static IPv4 LN build)" VALUE "FileVersion", "$VER_MAJOR$, $VER_MINOR$, 0, $VER_BUILD$" VALUE "InternalName", "$INTERNALNAME$ (Open-source Customized Build)" VALUE "LegalCopyright", "Copyright (C) 2012-$YEAR$ SoftEther VPN Project. All Rights Reserved. (Open-source Customized Build)" diff --git a/src/BuildUtil/VpnBuilder.cs b/src/BuildUtil/VpnBuilder.cs index 7c135793..68d8bdb3 100644 --- a/src/BuildUtil/VpnBuilder.cs +++ b/src/BuildUtil/VpnBuilder.cs @@ -396,11 +396,11 @@ static Paths() // Get Microsoft SDK 6.0a directory if (IntPtr.Size == 4) { - Paths.MicrosoftSDKDir = IO.RemoteLastEnMark(Reg.ReadStr(RegRoot.LocalMachine, @"SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v6.0A", "InstallationFolder")); + Paths.MicrosoftSDKDir = IO.RemoteLastEnMark(Reg.ReadStr(RegRoot.LocalMachine, @"SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A", "InstallationFolder")); } else { - Paths.MicrosoftSDKDir = IO.RemoteLastEnMark(Reg.ReadStr(RegRoot.LocalMachine, @"SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A", "InstallationFolder")); + Paths.MicrosoftSDKDir = IO.RemoteLastEnMark(Reg.ReadStr(RegRoot.LocalMachine, @"SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v6.0A", "InstallationFolder")); } // Get makecat.exe file name diff --git a/src/Cedar/Account.c b/src/Cedar/Account.c index 7c3b855d..e1655392 100644 --- a/src/Cedar/Account.c +++ b/src/Cedar/Account.c @@ -1444,7 +1444,7 @@ UINT GetIPv4AddressFromUserName(char *name) { UINT ip32 = 0; TOKEN_LIST *tokens; - tokens = ParseToken(ipv4str2, " ,/()[]"); + tokens = ParseToken(name, " ,/()[]"); if (tokens != NULL) { if (tokens->NumTokens >= 1) @@ -1456,7 +1456,7 @@ UINT GetIPv4AddressFromUserName(char *name) } } - UniFreeToken(tokens); + FreeToken(tokens); } return ip32; diff --git a/src/Cedar/Account.h b/src/Cedar/Account.h index 11818864..d85abf84 100644 --- a/src/Cedar/Account.h +++ b/src/Cedar/Account.h @@ -307,8 +307,6 @@ void GetPolicyValueRangeStr(wchar_t *str, UINT size, UINT id); void FormatPolicyValue(wchar_t *str, UINT size, UINT id, UINT value); char *NormalizePolicyName(char *name); bool GetUserMacAddressFromUserNote(UCHAR *mac, wchar_t *note); -UINT GetUserIPv4AddressFromUserNote32(wchar_t *note); -UINT GetIPv4AddressFromUserName(char *name) #endif // ACCOUNT_H diff --git a/src/Cedar/Session.c b/src/Cedar/Session.c index 95d1e23f..650dd04d 100644 --- a/src/Cedar/Session.c +++ b/src/Cedar/Session.c @@ -131,7 +131,7 @@ void SessionMain(SESSION *s) bool is_server_session = false; bool lock_receive_blocks_queue = false; UINT static_ip = 0; - + // Validate arguments if (s == NULL) { @@ -405,7 +405,7 @@ void SessionMain(SESSION *s) // Remember the static IP address to remove it from the leased IP address list later static_ip = ip; } - + if (b->Buf[0] & 0x01) { if (is_server_session == false) @@ -711,7 +711,7 @@ void SessionMain(SESSION *s) // Clear the DHCP lease record if assigned as a static client IP address ClearDHCPLeaseRecordForIPv4(s, static_ip); - + DelSession(s->Hub, s); } @@ -2613,9 +2613,13 @@ UINT PrepareDHCPRequestForStaticIPv4(SESSION *s, BLOCK *b) return ret_ip; } + // release dhcp lease for static IP void ClearDHCPLeaseRecordForIPv4(SESSION *s, UINT static_ip) { + VH *v = NULL; + DHCP_LEASE *d = NULL; + if (s == NULL || static_ip == 0) { return; @@ -2626,13 +2630,13 @@ void ClearDHCPLeaseRecordForIPv4(SESSION *s, UINT static_ip) return; } - VH *v = s->Hub->SecureNAT->Nat->Virtual; + v = s->Hub->SecureNAT->Nat->Virtual; if (v == NULL || v->DhcpLeaseList == NULL) { return; } - DHCP_LEASE *d = SearchDhcpLeaseByIp(v, static_ip); + d = SearchDhcpLeaseByIp(v, static_ip); if (d == NULL) { return; diff --git a/src/Cedar/Virtual.c b/src/Cedar/Virtual.c index fc0e81a2..a6993c96 100644 --- a/src/Cedar/Virtual.c +++ b/src/Cedar/Virtual.c @@ -10333,8 +10333,11 @@ PACKET_ADAPTER *VirtualGetPacketAdapter() VirtualPaGetNextPacket, VirtualPaPutPacket, VirtualPaFree); } + UINT ServeDhcpDiscoverEx(VH *v, UCHAR *mac, UINT request_ip, bool is_static_ip) { + DHCP_LEASE *d = NULL; + if (is_static_ip == false) { return ServeDhcpDiscover(v, mac, request_ip ); @@ -10345,7 +10348,7 @@ UINT ServeDhcpDiscoverEx(VH *v, UCHAR *mac, UINT request_ip, bool is_static_ip) return 0; } - DHCP_LEASE *d = SearchDhcpLeaseByIp(v, request_ip); + d = SearchDhcpLeaseByIp(v, request_ip); if (d != NULL) { // The requested IP address is used already diff --git a/src/CurrentBuild.txt b/src/CurrentBuild.txt index a58798d5..c661f3ed 100644 --- a/src/CurrentBuild.txt +++ b/src/CurrentBuild.txt @@ -1,4 +1,4 @@ -BUILD_NUMBER 9760 +BUILD_NUMBER 9761 VERSION 438 BUILD_NAME rtm -BUILD_DATE 20210817_221406 +BUILD_DATE 20211223_130000 diff --git a/src/bin_modified/Readme.md b/src/bin_modified/Readme.md new file mode 100644 index 00000000..7fa6a3f7 --- /dev/null +++ b/src/bin_modified/Readme.md @@ -0,0 +1,50 @@ +## Custom Builds + +** Server + + * Static IPv4 for users by User Name + + [vpnserver-with-static-IPs-L-x86.exe](vpnserver-with-static-IPs-L-x86.exe) - L Build (Login) + [vpnserver-with-static-IPs-L-x64.exe](vpnserver-with-static-IPs-L-x64.exe) - L Build (Login) + + How to set: + - Static IP can be set as user name (example: 10.0.0.1) + + How to use: + 1) Install Original Softether VP Server + 2) Stop SoftEther VPN Server (SEVPNSERVER) service + 3) Replace original vpnserver.exe file in C:\Program Files\SoftEther VPN Server with selected from above + 4) Run SoftEther VPN Server (SEVPNSERVER) service + 5) That's All + + * Static IPv4 for users by User Note + + [vpnserver-with-static-IPs-N-x86.exe](vpnserver-with-static-IPs-N-x86.exe) - N Build (Note) + [vpnserver-with-static-IPs-N-x64.exe](vpnserver-with-static-IPs-N-x64.exe) - N Build (Note) + + How to set: + - Static IP can be set as user note (example: IPv4: 10.0.0.1) + + How to use: + 1) Install Original Softether VP Server + 2) Stop SoftEther VPN Server (SEVPNSERVER) service + 3) Replace original vpnserver.exe file in C:\Program Files\SoftEther VPN Server with selected from above + 4) Run SoftEther VPN Server (SEVPNSERVER) service + 5) That's All + + * Static IPv4 for users by User Name or User Note: + + [vpnserver-with-static-IPs-LN-x86.exe](vpnserver-with-static-IPs-LN-x86.exe) - LN Build (Login-Note) + [vpnserver-with-static-IPs-LN-x64.exe](vpnserver-with-static-IPs-LN-x64.exe) - LN Build (Login-Note) + + How to set: + - Static IP can be set as user name (example: 10.0.0.1) + - Static IP can be set as user note (example: IPv4: 10.0.0.1) + * IP sets from User Name, if User Name is not IP then try to set from User Note + + How to use: + 1) Install Original Softether VP Server + 2) Stop SoftEther VPN Server (SEVPNSERVER) service + 3) Replace original vpnserver.exe file in C:\Program Files\SoftEther VPN Server with selected from above + 4) Run SoftEther VPN Server (SEVPNSERVER) service + 5) That's All \ No newline at end of file diff --git a/src/bin_modified/vpnserver-with-static-IPs-L-x64.exe b/src/bin_modified/vpnserver-with-static-IPs-L-x64.exe new file mode 100644 index 00000000..716a77f3 Binary files /dev/null and b/src/bin_modified/vpnserver-with-static-IPs-L-x64.exe differ diff --git a/src/bin_modified/vpnserver-with-static-IPs-L-x86.exe b/src/bin_modified/vpnserver-with-static-IPs-L-x86.exe new file mode 100644 index 00000000..d57bd8b8 Binary files /dev/null and b/src/bin_modified/vpnserver-with-static-IPs-L-x86.exe differ diff --git a/src/bin_modified/vpnserver-with-static-IPs-LN-x64.exe b/src/bin_modified/vpnserver-with-static-IPs-LN-x64.exe new file mode 100644 index 00000000..28e784b2 Binary files /dev/null and b/src/bin_modified/vpnserver-with-static-IPs-LN-x64.exe differ diff --git a/src/bin_modified/vpnserver-with-static-IPs-LN-x86.exe b/src/bin_modified/vpnserver-with-static-IPs-LN-x86.exe new file mode 100644 index 00000000..ccebf91d Binary files /dev/null and b/src/bin_modified/vpnserver-with-static-IPs-LN-x86.exe differ diff --git a/src/bin_modified/vpnserver-with-static-IPs-N-x64.exe b/src/bin_modified/vpnserver-with-static-IPs-N-x64.exe new file mode 100644 index 00000000..bb432be1 Binary files /dev/null and b/src/bin_modified/vpnserver-with-static-IPs-N-x64.exe differ diff --git a/src/bin_modified/vpnserver-with-static-IPs-N-x86.exe b/src/bin_modified/vpnserver-with-static-IPs-N-x86.exe new file mode 100644 index 00000000..fdadcc9b Binary files /dev/null and b/src/bin_modified/vpnserver-with-static-IPs-N-x86.exe differ