summaryrefslogtreecommitdiff
path: root/p11p-daemon/src/p11p_rpc.hrl
diff options
context:
space:
mode:
authorLinus Nordberg <linus@sunet.se>2020-01-09 10:15:08 +0100
committerLinus Nordberg <linus@sunet.se>2020-01-09 10:15:08 +0100
commit34278d385bb0d005972e5fc25a4d5d36e40733ee (patch)
treea6ed0507c9e2ff5ecd906adfa5b05c16796c68ee /p11p-daemon/src/p11p_rpc.hrl
parentfcfe6d7a24ef5c26881ff7feb40fefe0eac792b5 (diff)
Verify RPC version
Don't just forward the version octet, verify it and refuse other protocol versions. Send it once in each direction and don't count on the misconception that new client means new remote, or vice versa. Especially the latter, that a new remote means new client, will be untrue as soon as we implement failover.
Diffstat (limited to 'p11p-daemon/src/p11p_rpc.hrl')
-rw-r--r--p11p-daemon/src/p11p_rpc.hrl3
1 files changed, 3 insertions, 0 deletions
diff --git a/p11p-daemon/src/p11p_rpc.hrl b/p11p-daemon/src/p11p_rpc.hrl
index 8ccb0d1..c511e20 100644
--- a/p11p-daemon/src/p11p_rpc.hrl
+++ b/p11p-daemon/src/p11p_rpc.hrl
@@ -1,6 +1,9 @@
%%% Copyright (c) 2019, Sunet.
%%% See LICENSE for licensing information.
+%% The only RPC version we support.
+-define(RPC_VERSION, 0).
+
-record(p11rpc_msg, {
call_code = -1 :: integer(), % Length is 4
opt_len = -1 :: integer(), % Length is 4