From e3f0429ab342878c0b43f3c9be83076b1181e530 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Sat, 10 Sep 2016 17:01:02 +0800 Subject: [PATCH] Fix #819 --- src/udprelay.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/udprelay.c b/src/udprelay.c index 6237dc4f..397958c1 100644 --- a/src/udprelay.c +++ b/src/udprelay.c @@ -214,16 +214,11 @@ construct_udprealy_header(const struct sockaddr_storage *in_addr, static int parse_udprealy_header(const char *buf, const size_t buf_len, - int *auth, char *host, char *port, - struct sockaddr_storage *storage) + char *host, char *port, struct sockaddr_storage *storage) { const uint8_t atyp = *(uint8_t *)buf; int offset = 1; - if (auth != NULL) { - *auth |= (atyp & ONETIMEAUTH_FLAG); - } - // get remote addr and port if ((atyp & ADDRTYPE_MASK) == 1) { // IP V4 @@ -699,14 +694,14 @@ remote_recv_cb(EV_P_ ev_io *w, int revents) #ifdef MODULE_REDIR struct sockaddr_storage dst_addr; memset(&dst_addr, 0, sizeof(struct sockaddr_storage)); - int len = parse_udprealy_header(buf->array, buf->len, NULL, NULL, NULL, &dst_addr); + int len = parse_udprealy_header(buf->array, buf->len, NULL, NULL, &dst_addr); if (dst_addr.ss_family != AF_INET && dst_addr.ss_family != AF_INET6) { LOGI("[udp] ss-redir does not support domain name"); goto CLEAN_UP; } #else - int len = parse_udprealy_header(buf->array, buf->len, NULL, NULL, NULL, NULL); + int len = parse_udprealy_header(buf->array, buf->len, NULL, NULL, NULL); #endif if (len == 0) { @@ -1028,8 +1023,7 @@ server_recv_cb(EV_P_ ev_io *w, int revents) memset(&dst_addr, 0, sizeof(struct sockaddr_storage)); int addr_header_len = parse_udprealy_header(buf->array + offset, buf->len - offset, - &server_ctx->auth, host, port, - &dst_addr); + host, port, &dst_addr); if (addr_header_len == 0) { // error in parse header goto CLEAN_UP;