Skip to content

Commit

Permalink
inifile.c: correct /32 netmask for target_network
Browse files Browse the repository at this point in the history
  • Loading branch information
mezantrop committed Feb 7, 2025
1 parent f65097a commit 91e69db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# CHANGELOG

* **2025.02.05 Current**
* **2025.02.07 Current**
* `inifile.c`: correct `/32` netmask for `target_network`
* `gui-warp.py`/`gui-warp.py.in`: 'Password hash' caption
* `CONTRIBUTORS.md`: New contributor Marcin Nowicki <[email protected]>. Thanks for your ideas and testing!
* `build.sh`: `-no-tests` added for OpenSSL `Configure`; `-fembed-bitcode` removed for both OpenSSL and libssh2
Expand Down
6 changes: 3 additions & 3 deletions inifile.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,11 @@ ini_section *read_ini(char *ifile_name) {
default:
c_targ->ip1 = str2inet(entry.val1, entry.mod1);
if (entry.val2) {
int m;
int m = strtol(entry.val2, NULL, 10);
/* Build IPv4 address netmask based on CIDR */
if ((m = strtol(entry.val2, NULL, 10)) && m < 33 && target_type == INI_TARGET_NETWORK) {
if (m < 33 && m >= 0 && target_type == INI_TARGET_NETWORK) {
SIN4_FAMILY(c_targ->ip2) = AF_INET;
S4_ADDR(c_targ->ip2) = htonl(~(0xFFFFFFFF >> m));
S4_ADDR(c_targ->ip2) = m == 32 ? 0xFFFFFFFF : htonl(~(0xFFFFFFFF >> m));
} else
c_targ->ip2 = str2inet(entry.val2, entry.mod2);
}
Expand Down

0 comments on commit 91e69db

Please sign in to comment.