From 75d351eaf1264cfb7aa47166469e8ec722712a89 Mon Sep 17 00:00:00 2001 From: Ivo Timmermans Date: Sun, 30 Apr 2000 19:49:49 +0000 Subject: [PATCH] Protocol fix (ANS_KEY). This breaks 0.3.3 protocol compatibility. --- src/protocol.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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, -- 2.20.1