cache: dump hostname target from srv records
authorFelix Fietkau <nbd@nbd.name>
Thu, 19 Oct 2023 08:49:11 +0000 (10:49 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 19 Oct 2023 08:49:13 +0000 (10:49 +0200)
This can be used to look up the correct hostname to determine the ip addresses

Signed-off-by: Felix Fietkau <nbd@nbd.name>
cache.c

diff --git a/cache.c b/cache.c
index 30e192fd0dbfe7075c2a93b9d4c5df9558c7e434..9df051d59072502a6ca5985314fce5a497b7c3c9 100644 (file)
--- a/cache.c
+++ b/cache.c
@@ -454,6 +454,8 @@ cache_dump_records(struct blob_buf *buf, const char *name, int array)
                        break;
 
                case TYPE_SRV:
+                       if (r->rdata)
+                               blobmsg_add_string(buf, "host", (char *)r->rdata + sizeof(struct dns_srv_data));
                        if (r->port)
                                blobmsg_add_u32(buf, "port", r->port);
                        break;