Explorar o código

-s switch support for dnspr

dnspr -s switch to act as a simple DNS proxy and do not use 3proxy's
resolver and DNS cache.
z3APA3A %!s(int64=11) %!d(string=hai) anos
pai
achega
a4cb2f36b5
Modificáronse 3 ficheiros con 4 adicións e 3 borrados
  1. 1 0
      src/3proxy.c
  2. 2 2
      src/dnspr.c
  3. 1 1
      src/version.h

+ 1 - 0
src/3proxy.c

@@ -721,6 +721,7 @@ static int h_proxy(int argc, unsigned char ** argv){
 		childdef.port = 53;
 		childdef.isudp = 1;
 		childdef.service = S_DNSPR;
+		childdef.helpmessage = " -s - simple DNS forwarding - do not use 3proxy resolver / name cache\n";
 		if(!resolvfunc || (resolvfunc == myresolver && !dns_table.hashsize) || resolvfunc == fakeresolver){
 			fprintf(stderr, "[line %d] Warning: no nserver/nscache configured, dnspr will not work as expected\n", linenum);
 		}

+ 2 - 2
src/dnspr.c

@@ -82,7 +82,7 @@ void * dnsprchild(struct clientparam* param) {
  *s2 = (len - (int)(s2 - buf)) - 1;
 
  type = ((unsigned)buf[len+1])*256 + (unsigned)buf[len+2];
- if(type==1){
+ if(type==1 && !param->srv->singlepacket){
  	 ip = udpresolve((unsigned char *)host, &ttl, param, 0);
  }
 
@@ -129,7 +129,7 @@ void * dnsprchild(struct clientparam* param) {
 	}
 	else ip = 0;
  }
- if(!ip && nservers[0].ip && type!=1){
+ if(!ip && nservers[0].ip){
 	if((param->remsock=so._socket(PF_INET, nservers[0].usetcp? SOCK_STREAM:SOCK_DGRAM, nservers[0].usetcp?IPPROTO_TCP:IPPROTO_UDP)) == INVALID_SOCKET) {
 		RETURN(818);
 	}

+ 1 - 1
src/version.h

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