Browse Source

dns_server: fix discard issue.

Nick Peng 3 years ago
parent
commit
09dc2e9275
1 changed files with 0 additions and 10 deletions
  1. 0 10
      src/dns_server.c

+ 0 - 10
src/dns_server.c

@@ -2406,7 +2406,6 @@ static int _dns_server_passthrough_rule_check(struct dns_request *request, char
 	int j = 0;
 	int j = 0;
 	struct dns_rrs *rrs = NULL;
 	struct dns_rrs *rrs = NULL;
 	int ip_check_result = 0;
 	int ip_check_result = 0;
-	int is_result_discard = 1;
 
 
 	if (packet->head.rcode != DNS_RC_NOERROR && packet->head.rcode != DNS_RC_NXDOMAIN) {
 	if (packet->head.rcode != DNS_RC_NOERROR && packet->head.rcode != DNS_RC_NXDOMAIN) {
 		if (request->rcode == DNS_RC_SERVFAIL) {
 		if (request->rcode == DNS_RC_SERVFAIL) {
@@ -2422,10 +2421,6 @@ static int _dns_server_passthrough_rule_check(struct dns_request *request, char
 	for (j = 1; j < DNS_RRS_END; j++) {
 	for (j = 1; j < DNS_RRS_END; j++) {
 		rrs = dns_get_rrs_start(packet, j, &rr_count);
 		rrs = dns_get_rrs_start(packet, j, &rr_count);
 		for (i = 0; i < rr_count && rrs; i++, rrs = dns_get_rrs_next(packet, rrs)) {
 		for (i = 0; i < rr_count && rrs; i++, rrs = dns_get_rrs_next(packet, rrs)) {
-			if (rrs->type == request->qtype) {
-				is_result_discard = 0;
-			}
-
 			switch (rrs->type) {
 			switch (rrs->type) {
 			case DNS_T_A: {
 			case DNS_T_A: {
 				unsigned char addr[4];
 				unsigned char addr[4];
@@ -2487,11 +2482,6 @@ static int _dns_server_passthrough_rule_check(struct dns_request *request, char
 	}
 	}
 
 
 	*pttl = ttl;
 	*pttl = ttl;
-
-	if (is_result_discard == 1) {
-		return 0;
-	}
-
 	return -1;
 	return -1;
 }
 }