From a841673669604f5be838a0a0042f05e18ae3827c Mon Sep 17 00:00:00 2001 From: Klas Johansson Date: Sun, 20 Dec 2009 21:13:39 +0100 Subject: Handle "extra" field according to specs in ALIVE2_REQ and PORT2_RESP. Don't let the length field pollute the value of the "extra" field in ALIVE2_REQ. Extra was read, starting at the second byte of the two byte length field, which meant that it was included in the result and the last byte of the value was skipped: if "extra" is <<1, 2>>, return <<0, 2, 1, 2>> not <<0, 2, 2, 1>> Increment the offset correctly when sending PORT2_RESP, in order to make sure the "extra" field won't be truncated: if "extra" is <<>>, return <<0, 0>> not <<0>> if "extra" is <<1, 2>>, return <<0, 2, 1, 2>> not <<0, 2, 1>> Allow null characters in "extra". --- erts/epmd/src/epmd_int.h | 1 + 1 file changed, 1 insertion(+) (limited to 'erts/epmd/src/epmd_int.h') diff --git a/erts/epmd/src/epmd_int.h b/erts/epmd/src/epmd_int.h index b120b44579..30f731d49e 100644 --- a/erts/epmd/src/epmd_int.h +++ b/erts/epmd/src/epmd_int.h @@ -294,6 +294,7 @@ struct enode { char protocol; /* 0 = tcp/ipv4 */ unsigned short highvsn; /* 0 = OTP-R3 erts-4.6.x, 1 = OTP-R4 erts-4.7.x*/ unsigned short lowvsn; + int extralen; char extra[MAXSYMLEN+1]; }; -- cgit v1.2.3