summaryrefslogtreecommitdiff
path: root/src/mongo/db/wire_version.h
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2016-08-19 11:26:05 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2016-08-19 11:43:31 -0400
commit78c06c7e342bb159bcf22c85502cb7db3a695ffd (patch)
tree2ac566e4a34dd2945db79e949cc5c94d8463e034 /src/mongo/db/wire_version.h
parent1a3d60af4d27d72e15637bb43510fe1b592a6c43 (diff)
downloadmongo-78c06c7e342bb159bcf22c85502cb7db3a695ffd.tar.gz
SERVER-25393 Disallow mongos making connections to older versions
Diffstat (limited to 'src/mongo/db/wire_version.h')
-rw-r--r--src/mongo/db/wire_version.h38
1 files changed, 26 insertions, 12 deletions
diff --git a/src/mongo/db/wire_version.h b/src/mongo/db/wire_version.h
index 86f629e0ca7..de816c0ae1b 100644
--- a/src/mongo/db/wire_version.h
+++ b/src/mongo/db/wire_version.h
@@ -26,6 +26,10 @@
* it in the license file.
*/
+#pragma once
+
+#include "mongo/base/disallow_copying.h"
+
namespace mongo {
/**
@@ -63,6 +67,14 @@ enum WireVersion {
COMMANDS_ACCEPT_WRITE_CONCERN = 5,
};
+/**
+ * Struct to pass around information about wire version.
+ */
+struct WireVersionInfo {
+ int minWireVersion;
+ int maxWireVersion;
+};
+
struct WireSpec {
MONGO_DISALLOW_COPYING(WireSpec);
@@ -71,18 +83,20 @@ struct WireSpec {
return instance;
}
- // Minimum version that the server accepts on incoming requests. We should bump this whenever
- // we don't want to allow incoming connections from clients that are too old.
- int minWireVersionIncoming;
- // Latest version that the server accepts on incoming requests. This should always be at the
- // latest entry in WireVersion.
- int maxWireVersionIncoming;
-
- // Minimum version allowed on remote nodes when the server sends requests. We should bump this
- // whenever we don't want to connect to clients that are too old.
- int minWireVersionOutgoing;
- // Latest version allowed on remote nodes when the server sends requests.
- int maxWireVersionOutgoing;
+ // incoming.minWireVersion - Minimum version that the server accepts on incoming requests. We
+ // should bump this whenever we don't want to allow incoming connections from clients that are
+ // too old.
+
+ // incoming.maxWireVersion - Latest version that the server accepts on incoming requests. This
+ // should always be at the latest entry in WireVersion.
+ WireVersionInfo incoming;
+
+ // outgoing.minWireVersion - Minimum version allowed on remote nodes when the server sends
+ // requests. We should bump this whenever we don't want to connect to clients that are too old.
+
+ // outgoing.maxWireVersion - Latest version allowed on remote nodes when the server sends
+ // requests.
+ WireVersionInfo outgoing;
private:
WireSpec() = default;