Skip to content

Commit

Permalink
Merge !1470: lib/zonecut.c fetch_addr(): resurrect filtering by NO_IPV*
Browse files Browse the repository at this point in the history
  • Loading branch information
vcunat committed Nov 6, 2023
2 parents a2cacdc + 3bbda0a commit 417c98b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 8 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Knot Resolver 5.x.y (202y-mm-dd)
================================

Bugfixes
--------
- fix potential SERVFAIL deadlocks if net.ipv6 = false (#880)


Knot Resolver 5.7.0 (2023-08-22)
================================

Expand Down
7 changes: 5 additions & 2 deletions lib/zonecut.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
/** Information for one NS name + address type. */
typedef enum {
AI_UNINITED = 0,
AI_REPUT, /**< Don't use this addrset, due to: cache_rep, NO_IPV6, ...
* cache_rep approximates various problems when fetching the RRset. */
AI_DISABLED, /**< Can't use this addrset. */
AI_CYCLED, /**< Skipped due to cycle detection; see implementation for details. */
AI_LAST_BAD = AI_CYCLED, /** bad states: <= AI_LAST_BAD */
AI_UNKNOWN, /**< Don't know status of this RRset; various reasons. */
Expand Down Expand Up @@ -289,9 +288,13 @@ static addrset_info_t fetch_addr(pack_t *addrs, const knot_dname_t *ns, uint16_t
int rdlen;
switch (rrtype) {
case KNOT_RRTYPE_A:
if (qry->flags.NO_IPV4)
return AI_DISABLED;
rdlen = 4;
break;
case KNOT_RRTYPE_AAAA:
if (qry->flags.NO_IPV6 || no6_is_bad())
return AI_DISABLED;
rdlen = 16;
break;
default:
Expand Down

0 comments on commit 417c98b

Please sign in to comment.