From 3b9a84634011be606064024fa6795f493450c457 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 21 Sep 2015 13:40:42 +1000 Subject: [PATCH] Don't allow passthrough subclients to resume --- src/stratifier.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/stratifier.c b/src/stratifier.c index 5bdb9146..dc479330 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1370,6 +1370,12 @@ static stratum_instance_t *__stratum_add_instance(ckpool_t *ckp, const int64_t i return client; } +/* passthrough subclients have client_ids in the high bits */ +static inline bool passthrough_subclient(const int64_t client_id) +{ + return (client_id > 0xffffffffll); +} + static uint64_t disconnected_sessionid_exists(sdata_t *sdata, const char *sessionid, int *session_id, const int64_t id) { @@ -1378,6 +1384,10 @@ static uint64_t disconnected_sessionid_exists(sdata_t *sdata, const char *sessio uint64_t ret = 0; int slen; + /* Don't allow passthrough subclients to resume */ + if (passthrough_subclient(id)) + goto out; + if (!sessionid) goto out; slen = strlen(sessionid) / 2;