From f824686c3c519ab00582bb1f854fdfda5e4b1240 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 9 Apr 2019 16:29:03 +0200 Subject: Revert "erl_interface: Support 32-bit creation local cnode" This reverts commit 6454221ad87d1cd8fc877b424db3c4a8e9835577. --- lib/erl_interface/src/epmd/ei_epmd.h | 5 ++--- lib/erl_interface/src/epmd/epmd_publish.c | 28 +++++++++++----------------- 2 files changed, 13 insertions(+), 20 deletions(-) (limited to 'lib/erl_interface/src/epmd') diff --git a/lib/erl_interface/src/epmd/ei_epmd.h b/lib/erl_interface/src/epmd/ei_epmd.h index f72c354e32..ac153b6e66 100644 --- a/lib/erl_interface/src/epmd/ei_epmd.h +++ b/lib/erl_interface/src/epmd/ei_epmd.h @@ -25,8 +25,8 @@ #endif #ifndef EI_DIST_HIGH -#define EI_DIST_HIGH 6 /* OTP 22 and later */ -#define EI_DIST_LOW 5 /* OTP R4 - 21 */ +#define EI_DIST_HIGH 5 /* R4 and later */ +#define EI_DIST_LOW 1 /* R3 and earlier */ #endif #ifndef EPMD_PORT @@ -45,7 +45,6 @@ #ifndef EI_EPMD_ALIVE2_REQ #define EI_EPMD_ALIVE2_REQ 120 #define EI_EPMD_ALIVE2_RESP 121 -#define EI_EPMD_ALIVE2_X_RESP 118 #define EI_EPMD_PORT2_REQ 122 #define EI_EPMD_PORT2_RESP 119 #define EI_EPMD_STOP_REQ 's' diff --git a/lib/erl_interface/src/epmd/epmd_publish.c b/lib/erl_interface/src/epmd/epmd_publish.c index ef8a5d6b70..20b8e867e8 100644 --- a/lib/erl_interface/src/epmd/epmd_publish.c +++ b/lib/erl_interface/src/epmd/epmd_publish.c @@ -68,8 +68,7 @@ static int ei_epmd_r4_publish (int port, const char *alive, unsigned ms) int nlen = strlen(alive); int len = elen + nlen + 13; /* hard coded: be careful! */ int n; - int err, response, res; - unsigned creation; + int err, res, creation; ssize_t dlen; unsigned tmo = ms == 0 ? EI_SCLBK_INF_TMO : ms; @@ -125,10 +124,8 @@ static int ei_epmd_r4_publish (int port, const char *alive, unsigned ms) /* Don't close fd here! It keeps us registered with epmd */ s = buf; - response = get8(s); - if (response != EI_EPMD_ALIVE2_RESP && - response != EI_EPMD_ALIVE2_X_RESP) { - EI_TRACE_ERR1("ei_epmd_r4_publish","<- unknown (%d)",response); + if (((res=get8(s)) != EI_EPMD_ALIVE2_RESP)) { /* response */ + EI_TRACE_ERR1("ei_epmd_r4_publish","<- unknown (%d)",res); EI_TRACE_ERR0("ei_epmd_r4_publish","-> CLOSE"); ei_close__(fd); erl_errno = EIO; @@ -144,21 +141,18 @@ static int ei_epmd_r4_publish (int port, const char *alive, unsigned ms) return -1; } - if (response == EI_EPMD_ALIVE2_RESP) - creation = get16be(s); - else /* EI_EPMD_ALIVE2_X_RESP */ - creation = get32be(s); + creation = get16be(s); EI_TRACE_CONN2("ei_epmd_r4_publish", - " result=%d (ok) creation=%u",res,creation); + " result=%d (ok) creation=%d",res,creation); - /* - * Would be nice to somehow use the nice "unique" creation value - * received here from epmd instead of using the crappy one - * passed (already) to ei_connect_init. - */ + /* probably should save fd so we can close it later... */ + /* epmd_saveconn(OPEN,fd,alive); */ - /* return the descriptor */ + /* return the creation number, for no good reason */ + /* return creation;*/ + + /* no - return the descriptor */ return fd; } -- cgit v1.2.3