Quellcode durchsuchen

core: Include parameter skip_record in dns_cache_print_entry

Extend the return value of dns_cache_print_entry with
the parameter `rr_skip_record` for NAPTR records. The parameter
`rr_skip_record` indicates, whether the NAPTR record is skipped
due to issues reaching the destinations. Once a NAPTR record is
marked as skipped, it will no longer be used.

Reported by schneuwlym #4174
Mathias Schneuwly vor 6 Monaten
Ursprung
Commit
1f4e679550
1 geänderte Dateien mit 9 neuen und 0 gelöschten Zeilen
  1. 9 0
      src/core/dns_cache.c

+ 9 - 0
src/core/dns_cache.c

@@ -3898,6 +3898,15 @@ int dns_cache_print_entry(rpc_t *rpc, void *ctx, struct dns_hash_entry *e)
 					rpc->fault(ctx, 500, "Internal error adding naptr order");
 					return -1;
 				}
+				if(rpc->struct_add(sh, "s", "rr_skip_record",
+						   ((struct naptr_rdata *)(rr->rdata))->skip_record
+								   ? "yes"
+								   : "no")
+						< 0) {
+					rpc->fault(ctx, 500,
+							"Internal error adding naptr rr_skip_record");
+					return -1;
+				}
 				s.s = ((struct naptr_rdata *)(rr->rdata))->flags;
 				s.len = ((struct naptr_rdata *)(rr->rdata))->flags_len;
 				if(rpc->struct_add(sh, "S", "rr_flags", &s) < 0) {