Skip to content

Commit

Permalink
p2p: block old clients (<2.x) on in and out conn + build version bump…
Browse files Browse the repository at this point in the history
… to 280
  • Loading branch information
sowle committed Mar 21, 2024
1 parent 1790225 commit 921b447
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/common/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,12 +684,8 @@ std::string get_nix_version_display_string()

// got v_major, v_minor, v_revision

// allow 1.1.x and greater

if (v_major < 1)
return false;

if (v_major == 1 && v_minor < 1)
// allow 2.x and greater
if (v_major < 2)
return false;

return true;
Expand Down
2 changes: 1 addition & 1 deletion src/p2p/net_node.inl
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ namespace nodetool

if (!tools::check_remote_client_version(rsp.payload_data.client_version))
{
LOG_ERROR_CCONTEXT("COMMAND_HANDSHAKE Failed, wrong client version: " << rsp.payload_data.client_version << ", closing connection.");
LOG_PRINT_CC_YELLOW(context, "COMMAND_HANDSHAKE Failed, wrong client version: " << rsp.payload_data.client_version << ", closing connection.", LOG_LEVEL_1);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
#define PROJECT_REVISION "0"
#define PROJECT_VERSION PROJECT_MAJOR_VERSION "." PROJECT_MINOR_VERSION "." PROJECT_REVISION

#define PROJECT_VERSION_BUILD_NO 272
#define PROJECT_VERSION_BUILD_NO 280
#define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO)
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]"

0 comments on commit 921b447

Please sign in to comment.