]> jfr.im git - solanum.git/commitdiff
Skip any unhandled DNS record type
authorMalcolm Scott <redacted>
Sun, 10 May 2020 20:00:43 +0000 (21:00 +0100)
committerGitHub <redacted>
Sun, 10 May 2020 20:00:43 +0000 (21:00 +0100)
Currently the DNS resolver handles CNAME by skipping that record in the answer and looking for the subsequent A/AAAA/PTR record.  There are other record types which could be handled in the same way, e.g. DNAME, but their presence currently causes the answer parsing to be abandoned.  A better approach would be to skip *any* other record and just use the first A, AAAA or PTR in the answer, regardless of what comes before it.

authd/res.c

index 9c07c3951815f5ce4dadde0ea31c3c0ce807d026..0336b46242734adb126e2ceadcdfaeb9bd32de05 100644 (file)
@@ -702,13 +702,9 @@ static int proc_answer(struct reslist *request, HEADER * header, char *buf, char
                        rb_strlcpy(request->name, hostbuf, IRCD_RES_HOSTLEN + 1);
 
                        return (1);
-               case T_CNAME:
-                       /* real answer will follow */
-                       current += rd_length;
-                       break;
-               default:
-                       break;
                }
+               /* skip any other record type e.g. CNAME, DNAME; real answer should follow */
+               current += rd_length;
        }
 
        return (1);