[PATCH] DO NOT APPLY: test generating MSG1 extrainfo

Ian Jackson ijackson at chiark.greenend.org.uk
Thu Jul 25 18:45:25 BST 2013


This advertises some early capabilities and puts some further extra
data in MSG1.  Using the version with this patch it's possible to test
the tolerance to new packets of the intended new version.

Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>

---
 magic.h |    2 +-
 site.c  |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/magic.h b/magic.h
index 598a79e..e333dfa 100644
--- a/magic.h
+++ b/magic.h
@@ -18,7 +18,7 @@
 #define LABEL_PROD    0x0a0a0a0a
 
 /* uses of the 32-bit capability bitmap */
-#define CAPAB_EARLY           0x00000000 /* no Early flags yet (see NOTES) */
+#define CAPAB_EARLY           0x00080000 /* no Early flags yet (see NOTES) */
 #define CAPAB_TRANSFORM_MASK  0x0000ffff
 /* remaining 16 bits are unused */
 
diff --git a/site.c b/site.c
index 0b39232..f346f4a 100644
--- a/site.c
+++ b/site.c
@@ -487,6 +487,7 @@ static bool_t generate_msg(struct site *st, uint32_t type, cstring_t what)
     if ((st->local_capabilities & CAPAB_EARLY) || (type != LABEL_MSG1)) {
 	buf_append_uint32(&st->buffer,st->local_capabilities);
     }
+    buf_append_uint32(&st->buffer, 0x6767aaaa);
     append_string_xinfo_done(&st->buffer,&xia);
 
     buf_append_string(&st->buffer,st->remotename);
@@ -1722,7 +1723,7 @@ static list_t *site_apply(closure_t *self, struct cloc loc, dict_t *context,
 
     assert(index_sequence < 0xffffffffUL);
     st->index = ++index_sequence;
-    st->local_capabilities = 0;
+    st->local_capabilities = 0xe0000;
     st->netlink=find_cl_if(dict,"link",CL_NETLINK,True,"site",loc);
 
 #define GET_CLOSURE_LIST(dictkey,things,nthings,CL_TYPE) do{		\
-- 
tg: (9502034..) junk/future-test (depends on: empty/tip)



More information about the sgo-software-discuss mailing list