From 67f06ce5e5dbd7912ba8a6b9055c2dc28614a411 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 20 Oct 2020 15:44:58 -0700 Subject: [PATCH] vere: adds comments discussing protocol-version constraints --- pkg/urbit/vere/io/ames.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pkg/urbit/vere/io/ames.c b/pkg/urbit/vere/io/ames.c index d8e47987e..163469439 100644 --- a/pkg/urbit/vere/io/ames.c +++ b/pkg/urbit/vere/io/ames.c @@ -1007,6 +1007,19 @@ _ames_hear(u3_ames* sam_u, u3_head hed_u; u3_body bod_u; + // XX packet filtering needs to revised for two protocol-change scenarios + // + // - packets using old protocol versions from our sponsees + // these must be let through, and this is a transitive condition; + // they must also be forwarded where appropriate + // they can be validated, as we know their semantics + // + // - packets using newer protocol versions + // these should probably be let through, or at least + // trigger printfs suggesting upgrade. + // they cannot be filtered, as we do not know their semantics + // + // unpack header, ensuring buffer is large enough // if ( (4 > len_w) @@ -1020,7 +1033,7 @@ _ames_hear(u3_ames* sam_u, // ensure the protocol version matches ours // - // XX rethink + // XX rethink use of [fit_o] here and elsewhere // if ( (c3y == sam_u->fig_u.fit_o) && (sam_u->ver_y != hed_u.ver_y) ) @@ -1243,6 +1256,9 @@ _ames_prot_scry_cb(void* vod_p, u3_noun nun) sam_u->ver_y = ver; } + // XX revise: filtering should probably be disabled if + // we get a protocol version above the latest one we know + // sam_u->fig_u.fit_o = c3y; u3z(nun); }