return more random serial generation

This commit is contained in:
z3APA3A 2014-12-11 03:49:26 +03:00
parent 8c95f4efcf
commit efdbaee29f
2 changed files with 6 additions and 3 deletions

View File

@ -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;
}

View File

@ -1,2 +1,2 @@
#define VERSION "3proxy-0.8b-devel"
#define BUILDDATE "141211031205"
#define BUILDDATE "141211034918"