Repository navigation
Commit 843a89c
dns: share reply parsing skeleton between record parsers
The MX, CAA, TLSA, TXT, SRV, and NAPTR reply parsers each repeated the
same structure: lazily create the record dictionary template, parse the
reply, iterate the answer section filtering by record type, build and
append each record, and report ENODATA when nothing matched. Factor
that into GetRecordTemplate(), ForEachAnswer(), and AppendRecord()
helpers so each parser only contains its record-specific extraction.
Behavior is unchanged, including TLSA results being indexed by answer
position and never reporting ENODATA.
Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: #67497
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>1 parent a625b01 commit 843a89c
1 file changed
Lines changed: 246 additions & 353 deletions
0 commit comments