X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fmeta.c;h=4077029849058b0d2b321df5d22ce67e561a7fef;hp=e60c127a82ad6123542d73f636dde6099a08ce83;hb=a84e449861eadee9361b7e0084379f5033894aab;hpb=4590ab63d93b1dd6e7df019b592f6dabc02a0f96 diff --git a/src/meta.c b/src/meta.c index e60c127a..40770298 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"); } 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; }