From: Ivo Timmermans Date: Sun, 30 Apr 2000 19:49:49 +0000 (+0000) Subject: Protocol fix (ANS_KEY). This breaks 0.3.3 protocol compatibility. X-Git-Tag: release-1.0pre1~25 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=75d351eaf1264cfb7aa47166469e8ec722712a89;p=tinc Protocol fix (ANS_KEY). This breaks 0.3.3 protocol compatibility. --- diff --git a/src/protocol.c b/src/protocol.c index 4935dc23..18fe4409 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -738,19 +738,21 @@ int ans_key_h(conn_list_t *cl) conn_list_t *fw, *gk; char *key; cp - if(read(cl->meta_socket, &((char*)(&tmp))[1], sizeof(tmp)-3) <= 0) + if(read(cl->meta_socket, &((char*)(&tmp))[1], sizeof(tmp) - 3) <= 0) { syslog(LOG_ERR, "%d: Receive failed: %m", __LINE__); return -1; } + syslog(LOG_DEBUG, "%08lx %08lx %d %hd", tmp.from, tmp.to, tmp.expiry, tmp.len); key = xmalloc(tmp.len); - - if(read(cl->meta_socket, key, tmp.len + 1) <= 0) + + if(read(cl->meta_socket, key, tmp.len + 2) <= 0) { syslog(LOG_ERR, "%d: Receive failed: %m", __LINE__); return -1; } + syslog(LOG_DEBUG, "%s", key); if(debug_lvl > 3) syslog(LOG_DEBUG, "got ANS_KEY from " IP_ADDR_S " for " IP_ADDR_S,