From efdbaee29ffb5be4dda9ce6753b9223d702b239d Mon Sep 17 00:00:00 2001 From: z3APA3A <3APA3A@3proxy.ru> Date: Thu, 11 Dec 2014 03:49:26 +0300 Subject: [PATCH] return more random serial generation --- src/auth.c | 7 +++++-- src/version.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/auth.c b/src/auth.c index c149e1a..0525f95 100644 --- a/src/auth.c +++ b/src/auth.c @@ -973,6 +973,7 @@ unsigned long udpresolve(unsigned char * name, unsigned *retttl, struct clientpa time_t t; struct sockaddr_in sin, *sinsp; int usetcp = 0; + unsigned short serial = 1; buf = b+2; @@ -1010,7 +1011,9 @@ unsigned long udpresolve(unsigned char * name, unsigned *retttl, struct clientpa } } len = (int)strlen((char *)name); - *(unsigned short*)buf = htons(i+1); /* query id */ + + serial = myrand(name,len); + *(unsigned short*)buf = serial; /* query id */ buf[2] = 1; /* recursive */ buf[3] = 0; buf[4] = 0; @@ -1054,7 +1057,7 @@ unsigned long udpresolve(unsigned char * name, unsigned *retttl, struct clientpa buf+=2; len-=2; } - if(*(unsigned short *)buf != htons(i+1))continue; + if(*(unsigned short *)buf != serial)continue; if((na = buf[7] + (((unsigned short)buf[6])<<8)) < 1) { return 0; } diff --git a/src/version.h b/src/version.h index c2572d8..b96ed57 100644 --- a/src/version.h +++ b/src/version.h @@ -1,2 +1,2 @@ #define VERSION "3proxy-0.8b-devel" -#define BUILDDATE "141211031205" +#define BUILDDATE "141211034918"