X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fmeta.c;h=0b8a379b2b70bc87c8e527aa8d249dbfe8005dfe;hp=e60c127a82ad6123542d73f636dde6099a08ce83;hb=a0c544df5d882bea812fb0ef648cdee98939e89c;hpb=4590ab63d93b1dd6e7df019b592f6dabc02a0f96 diff --git a/src/meta.c b/src/meta.c index e60c127a..0b8a379b 100644 --- a/src/meta.c +++ b/src/meta.c @@ -1,6 +1,6 @@ /* meta.c -- handle the meta communication - Copyright (C) 2000-2009 Guus Sliepen , + Copyright (C) 2000-2013 Guus Sliepen , 2000-2005 Ivo Timmermans 2006 Scott Lamb @@ -178,19 +178,19 @@ bool receive_meta(connection_t *c) { if(c->tcplen) { if(c->tcplen <= c->buflen) { if(!c->node) { - if(proxytype == PROXY_SOCKS4 && c->allow_request == ID) { + if(c->outgoing && proxytype == PROXY_SOCKS4 && c->allow_request == ID) { if(c->buffer[0] == 0 && c->buffer[1] == 0x5a) { - logger(LOG_DEBUG, "Proxy request granted"); + ifdebug(CONNECTIONS) logger(LOG_DEBUG, "Proxy request granted"); } else { logger(LOG_ERR, "Proxy request rejected"); return false; } - } else if(proxytype == PROXY_SOCKS5 && c->allow_request == ID) { + } else if(c->outgoing && proxytype == PROXY_SOCKS5 && c->allow_request == ID) { if(c->buffer[0] != 5) { logger(LOG_ERR, "Invalid response from proxy server"); return false; } - if(c->buffer[1] == 0xff) { + if(c->buffer[1] == (char)0xff) { logger(LOG_ERR, "Proxy request rejected: unsuitable authentication method"); return false; } @@ -199,9 +199,9 @@ bool receive_meta(connection_t *c) { return false; } if(c->buffer[3] == 0) { - logger(LOG_DEBUG, "Proxy request granted"); + ifdebug(CONNECTIONS) logger(LOG_DEBUG, "Proxy request granted"); } else { - logger(LOG_DEBUG, "Proxy request rejected"); + logger(LOG_ERR, "Proxy request rejected"); return false; } } else {