@@ -240,18 +240,7 @@ static int _dns_server_process_answer_HTTPS(struct dns_rrs *rrs, struct dns_requ
240
240
struct dns_https_param * p = NULL ;
241
241
int priority = 0 ;
242
242
struct dns_request_https * https_svcb ;
243
- int no_ipv4 = 0 ;
244
- int no_ipv6 = 0 ;
245
243
struct dns_https_record_rule * https_record_rule = _dns_server_get_dns_rule (request , DOMAIN_RULE_HTTPS );
246
- if (https_record_rule ) {
247
- if (https_record_rule -> filter .no_ipv4hint ) {
248
- no_ipv4 = 1 ;
249
- }
250
-
251
- if (https_record_rule -> filter .no_ipv6hint ) {
252
- no_ipv6 = 1 ;
253
- }
254
- }
255
244
256
245
ret = dns_get_HTTPS_svcparm_start (rrs , & p , name , DNS_MAX_CNAME_LEN , & ttl , & priority , target , DNS_MAX_CNAME_LEN );
257
246
if (ret != 0 ) {
@@ -290,7 +279,7 @@ static int _dns_server_process_answer_HTTPS(struct dns_rrs *rrs, struct dns_requ
290
279
} break ;
291
280
case DNS_HTTPS_T_IPV4HINT : {
292
281
struct dns_rule_address_IPV4 * address_ipv4 = NULL ;
293
- if (_dns_server_is_return_soa_qtype (request , DNS_T_A ) || no_ipv4 == 1 ) {
282
+ if (_dns_server_is_return_soa_qtype (request , DNS_T_A ) || ( https_record_rule && https_record_rule -> filter . no_ipv4hint ) ) {
294
283
break ;
295
284
}
296
285
@@ -311,6 +300,10 @@ static int _dns_server_process_answer_HTTPS(struct dns_rrs *rrs, struct dns_requ
311
300
}
312
301
} break ;
313
302
case DNS_HTTPS_T_ECH : {
303
+ if (https_record_rule && https_record_rule -> filter .no_ech ) {
304
+ break ;
305
+ }
306
+
314
307
if (p -> len > sizeof (https_svcb -> ech )) {
315
308
tlog (TLOG_WARN , "ech too long" );
316
309
break ;
@@ -321,7 +314,7 @@ static int _dns_server_process_answer_HTTPS(struct dns_rrs *rrs, struct dns_requ
321
314
case DNS_HTTPS_T_IPV6HINT : {
322
315
struct dns_rule_address_IPV6 * address_ipv6 = NULL ;
323
316
324
- if (_dns_server_is_return_soa_qtype (request , DNS_T_AAAA ) || no_ipv6 == 1 ) {
317
+ if (_dns_server_is_return_soa_qtype (request , DNS_T_AAAA ) || ( https_record_rule && https_record_rule -> filter . no_ipv6hint ) ) {
325
318
break ;
326
319
}
327
320
0 commit comments