Skip to content

Commit 4e8b38d

Browse files
authored
Prepare v10 release (#323)
* Prepare v10 release
1 parent 88b4190 commit 4e8b38d

16 files changed

+183
-219
lines changed

CHANGELOG.md

Lines changed: 12 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## main
99

10-
## v10.0.0-rc4
11-
12-
### Fixed
13-
14-
- Remove API blocking use of keyNNNN in SVCB records
15-
- Fix keyNNNN content encoding
16-
- Always quote values in svcb params
17-
18-
## v10.0.0-rc3
10+
## v10
1911

2012
### Added
2113

14+
- Better overload management ([#301](https://github.com/dnsimple/erldns/pull/301) [#302](https://github.com/dnsimple/erldns/pull/302) [#306](https://github.com/dnsimple/erldns/pull/306))
15+
- RFC7766 pipelining support for TCP/TLS with concurrent request processing ([#300](https://github.com/dnsimple/erldns/pull/300))
16+
- DNS over TLS (DoT) support per RFC 7858 ([#300](https://github.com/dnsimple/erldns/pull/300))
17+
- Configurable request timeout monitoring for TCP workers with SERVFAIL responses ([#300](https://github.com/dnsimple/erldns/pull/300))
18+
- Codec support for SVCB and HTTPS record types ([#313](https://github.com/dnsimple/erldns/pull/313))
2219
- Codec support for many new record types introduced in `dns_erlang` v4.9.0 ([#312](https://github.com/dnsimple/erldns/pull/312)):
2320
- OPENPGPKEY (Type 61) — RFC 7929
2421
- SMIMEA (Type 53) — RFC 8162
@@ -27,53 +24,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2724
- EUI48 (Type 108) and EUI64 (Type 109) — RFC 7043
2825
- CSYNC (Type 62) — RFC 7477
2926
- DSYNC (Type 66) — RFC 9859
30-
31-
### Fixed
32-
33-
- Fix wrong dot logic around SVCB and HTTPS records in the codec ([#319](https://github.com/dnsimple/erldns/pull/319))
34-
35-
### Documentation
36-
3727
- Add initial documentation regarding the Admin API ([#316](https://github.com/dnsimple/erldns/pull/316))
3828

39-
## v10.0.0-rc2
40-
41-
### Added
42-
43-
- Codec support for SVCB and HTTPS record types ([#313](https://github.com/dnsimple/erldns/pull/313))
44-
45-
### Removed
46-
47-
- `rfc_compliant_ent` configuration option. RFC 4592 compliant empty non-terminal (ENT) handling is now always enabled ([#308](https://github.com/dnsimple/erldns/pull/308))
48-
49-
### Fixed
50-
51-
- Fix false error raised in TCP listener initialization when gen_server exits normally ([#311](https://github.com/dnsimple/erldns/pull/311))
52-
53-
## v10.0.0-rc1
54-
55-
### Added
56-
57-
- RFC7766 pipelining support for TCP/TLS with concurrent request processing ([#300](https://github.com/dnsimple/erldns/pull/300))
58-
- DNS over TLS (DoT) support per RFC 7858 ([#300](https://github.com/dnsimple/erldns/pull/300))
59-
- Configurable request timeout monitoring for TCP workers with SERVFAIL responses ([#300](https://github.com/dnsimple/erldns/pull/300))
60-
6129
### Changed
6230

6331
- Move TCP and UDP ingress timeout configuration to per-listener `opts` map ([#300](https://github.com/dnsimple/erldns/pull/300))
6432
- Rename transport type `both` to `standard` for clarity ([#300](https://github.com/dnsimple/erldns/pull/300))
65-
66-
### Removed
67-
68-
- Global `ingress_tcp_request_timeout` and `ingress_udp_request_timeout` application environment variables ([#300](https://github.com/dnsimple/erldns/pull/300))
69-
70-
### Updated
71-
72-
- Upgrade dns_erlang dependency ([#305](https://github.com/dnsimple/erldns/pull/305))
33+
- Upgrade dns_erlang dependency
7334
- Includes small performance optimisations
7435
- Adds support for many new record types
7536
- Adds `dns:decode_query/1` for early stop of bad input
7637

38+
### Removed
39+
40+
- `rfc_compliant_ent` configuration option. RFC 4592 compliant empty non-terminal (ENT) handling is now always enabled ([#308](https://github.com/dnsimple/erldns/pull/308))
41+
- Global `ingress_tcp_request_timeout` and `ingress_udp_request_timeout` application environment variables are now configured per listener ([#300](https://github.com/dnsimple/erldns/pull/300))
42+
7743
## v9.1.0
7844

7945
### Added

rebar.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
{deps, [
3030
{ranch, "~> 2.0"},
3131
{cowboy, "~> 2.0"},
32-
{dns_erlang, "~> 4.9"},
32+
{dns_erlang, "~> 5.0"},
3333
{telemetry, "~> 1.3"},
3434
{segmented_cache, "~> 0.6"},
3535
{worker_pool, "~> 6.5"},

rebar.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[{<<"base32">>,{pkg,<<"base32">>,<<"1.0.0">>},1},
33
{<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.14.2">>},0},
44
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.16.0">>},1},
5-
{<<"dns_erlang">>,{pkg,<<"dns_erlang">>,<<"4.9.2">>},0},
5+
{<<"dns_erlang">>,{pkg,<<"dns_erlang">>,<<"5.0.2">>},0},
66
{<<"ranch">>,{pkg,<<"ranch">>,<<"2.2.0">>},0},
77
{<<"recon">>,{pkg,<<"recon">>,<<"2.5.6">>},0},
88
{<<"segmented_cache">>,{pkg,<<"segmented_cache">>,<<"0.6.0">>},0},
@@ -13,7 +13,7 @@
1313
{<<"base32">>, <<"1AB331F812FCC254C8F7D4348E1E5A6F2B9B32B7A260BF2BC3358E3BF14C841A">>},
1414
{<<"cowboy">>, <<"4008BE1DF6ADE45E4F2A4E9E2D22B36D0B5ABA4E20B0A0D7049E28D124E34847">>},
1515
{<<"cowlib">>, <<"54592074EBBBB92EE4746C8A8846E5605052F29309D3A873468D76CDF932076F">>},
16-
{<<"dns_erlang">>, <<"BB87EEA995B13692198BD31C5D951209C69205DCC47E6C3780BE161D8C9DE481">>},
16+
{<<"dns_erlang">>, <<"8D67F0A824330E16040DC95DA2B2E1E510C8DFD3E23FB8A172255E6ED225B544">>},
1717
{<<"ranch">>, <<"25528F82BC8D7C6152C57666CA99EC716510FE0925CB188172F41CE93117B1B0">>},
1818
{<<"recon">>, <<"9052588E83BFEDFD9B72E1034532AEE2A5369D9D9343B61AEB7FBCE761010741">>},
1919
{<<"segmented_cache">>, <<"C1F2897C49472663AAA4D56D9A154BC7A3F380E88D22C789A491A33AA41F3FBA">>},
@@ -23,7 +23,7 @@
2323
{<<"base32">>, <<"0449285348ED0C4CD83C7198E76C5FD5A0451C4EF18695B9FD43792A503E551A">>},
2424
{<<"cowboy">>, <<"569081DA046E7B41B5DF36AA359BE71A0C8874E5B9CFF6F747073FC57BAF1AB9">>},
2525
{<<"cowlib">>, <<"7F478D80D66B747344F0EA7708C187645CFCC08B11AA424632F78E25BF05DB51">>},
26-
{<<"dns_erlang">>, <<"34EBA9A13344776C2B7AC049850BD4BD264D682A474BAD61A58C3EDE8846EFD5">>},
26+
{<<"dns_erlang">>, <<"2F3366E94349B74C50A1B90CFA29583D4C4659EF6548DCCCD9BA00E52D2B0096">>},
2727
{<<"ranch">>, <<"FA0B99A1780C80218A4197A59EA8D3BDAE32FBFF7E88527D7D8A4787EFF4F8E7">>},
2828
{<<"recon">>, <<"96C6799792D735CC0F0FD0F86267E9D351E63339CBE03DF9D162010CEFC26BB0">>},
2929
{<<"segmented_cache">>, <<"1054EF672A9547D0755C949A29099A6C6E0D5A91052BE5F841296298860BC4D4">>},

src/erldns_handler.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ call_handlers(Message, QLabels, QType, Records) ->
115115
call_handlers_fun(Message, QLabels, ?DNS_TYPE_ANY, Records) ->
116116
fun
117117
({Handler, _, _, _, _, ?MINIMUM_HANDLER_VERSION}) ->
118-
Handler(dns:labels_to_dname(QLabels), ?DNS_TYPE_ANY, Records, Message);
118+
Handler(dns_domain:join(QLabels), ?DNS_TYPE_ANY, Records, Message);
119119
({Handler, _, _, _, _, ?DEFAULT_HANDLER_VERSION}) ->
120120
Handler(Message, QLabels, ?DNS_TYPE_ANY, Records)
121121
end;
122122
call_handlers_fun(Message, QLabels, QType, Records) ->
123123
fun
124124
({Handler, _, _, _, Types, ?MINIMUM_HANDLER_VERSION}) ->
125125
case lists:member(QType, Types) of
126-
true -> Handler(dns:labels_to_dname(QLabels), QType, Records, Message);
126+
true -> Handler(dns_domain:join(QLabels), QType, Records, Message);
127127
false -> []
128128
end;
129129
({Handler, _, _, _, Types, ?DEFAULT_HANDLER_VERSION}) ->

src/erldns_records.erl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
-doc "If given Name is a wildcard name then the original qname needs to be returned in its place.".
3636
-spec optionally_convert_wildcard(dns:dname(), dns:dname()) -> dns:dname().
3737
optionally_convert_wildcard(Name, Qname) ->
38-
case dns:dname_to_labels(Name) of
38+
case dns_domain:split(Name) of
3939
[~"*" | _] ->
4040
Qname;
4141
[_ | _] ->
@@ -49,8 +49,8 @@ Replaces the leading label with an asterisk for wildcard lookup.
4949
""".
5050
-spec wildcard_qname(dns:dname()) -> dns:dname().
5151
wildcard_qname(Qname) ->
52-
[_ | Rest] = dns:dname_to_labels(Qname),
53-
dns:labels_to_dname([~"*" | Rest]).
52+
[_ | Rest] = dns_domain:split(Qname),
53+
dns_domain:join([~"*" | Rest]).
5454

5555
-doc "Return the TTL value or 3600 if it is undefined.".
5656
-spec default_ttl(integer() | undefined) -> integer().
@@ -111,11 +111,11 @@ match_types(Types) ->
111111

112112
-spec match_wildcard() -> fun((dns:rr()) -> boolean()).
113113
match_wildcard() ->
114-
fun(#dns_rr{name = RRName}) -> lists:member(~"*", dns:dname_to_labels(RRName)) end.
114+
fun(#dns_rr{name = RRName}) -> lists:member(~"*", dns_domain:split(RRName)) end.
115115

116116
-spec match_not_wildcard() -> fun((dns:rr()) -> boolean()).
117117
match_not_wildcard() ->
118-
fun(#dns_rr{name = RRName}) -> not lists:member(~"*", dns:dname_to_labels(RRName)) end.
118+
fun(#dns_rr{name = RRName}) -> not lists:member(~"*", dns_domain:split(RRName)) end.
119119

120120
-spec match_wildcard_label() -> fun((binary()) -> boolean()).
121121
match_wildcard_label() ->

src/listeners/erldns_encoder.erl

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ Encode the DNS message into its binary representation.
2626
""".
2727
-spec encode_message(dns:message()) -> dns:message_bin().
2828
encode_message(Message) ->
29-
try dns:encode_message(Message) of
30-
M ->
31-
M
29+
try
30+
dns:encode_message(Message)
3231
catch
3332
Class:Reason:Stacktrace ->
3433
?LOG_ERROR(
@@ -50,14 +49,13 @@ Encode the DNS message into its binary representation.
5049
Use the Opts argument to pass in encoding options.
5150
""".
5251
-spec encode_message(dns:message(), dns:encode_message_opts()) ->
53-
{false, dns:message_bin()}
54-
| {true, dns:message_bin(), dns:message()}
55-
| {false, dns:message_bin(), dns:tsig_mac()}
56-
| {true, dns:message_bin(), dns:tsig_mac(), dns:message()}.
52+
dns:message_bin()
53+
| {dns:message_bin(), dns:tsig_mac()}
54+
| {truncated, dns:message_bin(), dns:message()}
55+
| {truncated, dns:message_bin(), dns:tsig_mac(), dns:message()}.
5756
encode_message(Message, Opts) ->
58-
try dns:encode_message(Message, Opts) of
59-
M ->
60-
M
57+
try
58+
dns:encode_message(Message, Opts)
6159
catch
6260
Class:Reason:Stacktrace ->
6361
?LOG_ERROR(
@@ -71,7 +69,7 @@ encode_message(Message, Opts) ->
7169
},
7270
#{domain => [erldns, listeners]}
7371
),
74-
{false, encode_message(build_error_response(Message))}
72+
encode_message(build_error_response(Message))
7573
end.
7674

7775
% Private functions

src/listeners/udp/erldns_proto_udp.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ handle_pipeline_response(Socket, IpAddr, Port, TS0, #dns_message{} = Response) -
130130
Result = erldns_encoder:encode_message(Response, #{}),
131131
EncodedResponse =
132132
case Result of
133-
{false, Enc} -> Enc;
134-
{false, Enc, _TsigMac} -> Enc;
135-
{true, Enc, #dns_message{} = _Message} -> Enc;
136-
{true, Enc, _TsigMac, #dns_message{} = _Message} -> Enc
133+
{truncated, Enc, _TsigMac, #dns_message{} = _Message} -> Enc;
134+
{truncated, Enc, #dns_message{} = _Message} -> Enc;
135+
{Enc, _TsigMac} -> Enc;
136+
Enc -> Enc
137137
end,
138138
gen_udp:send(Socket, IpAddr, Port, EncodedResponse),
139139
measure_time(Response, EncodedResponse, TS0).

src/pipes/erldns_dnssec.erl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ key_rrset_signer(ZoneName, RRs) ->
8686
PrivateKey = Keyset#keyset.key_signing_key,
8787
Inception = Keyset#keyset.inception,
8888
Expiration = Keyset#keyset.valid_until,
89-
dnssec:sign_rr(RRs, dns:dname_to_lower(ZoneName), Keytag, Alg, PrivateKey, #{
89+
dnssec:sign_rr(RRs, dns_domain:to_lower(ZoneName), Keytag, Alg, PrivateKey, #{
9090
inception => Inception, expiration => Expiration
9191
})
9292
end.
@@ -105,7 +105,7 @@ zone_rrset_signer(ZoneName, RRs) ->
105105
PrivateKey = Keyset#keyset.zone_signing_key,
106106
Inception = Keyset#keyset.inception,
107107
Expiration = Keyset#keyset.valid_until,
108-
dnssec:sign_rr(RRs, dns:dname_to_lower(ZoneName), Keytag, Alg, PrivateKey, #{
108+
dnssec:sign_rr(RRs, dns_domain:to_lower(ZoneName), Keytag, Alg, PrivateKey, #{
109109
inception => Inception, expiration => Expiration
110110
})
111111
end.
@@ -165,8 +165,8 @@ handle(#dns_message{answers = [], authority = MsgAuths} = Msg, Zone, QName, QTyp
165165
ApexRecords = erldns_zone_cache:get_records_by_name(Zone#zone.name),
166166
ApexRRSigRecords = lists:filter(erldns_records:match_type(?DNS_TYPE_RRSIG), ApexRecords),
167167
SoaRRSigRecords = maybe_get_soa_rrsig_records(ApexRRSigRecords, MsgAuths),
168-
NameToNormalise = dns:labels_to_dname([?NEXT_DNAME_PART | dns:dname_to_labels(QName)]),
169-
NextDname = dns:dname_to_lower(NameToNormalise),
168+
NameToNormalise = dns_domain:join([?NEXT_DNAME_PART | dns_domain:split(QName)]),
169+
NextDname = dns_domain:to_lower(NameToNormalise),
170170
RecordTypesForQname = record_types_for_name(Zone, QName),
171171
NsecRrTypes = erldns_handler:call_map_nsec_rr_types(QType, RecordTypesForQname),
172172
NsecRecords =
@@ -243,7 +243,7 @@ find_unsigned_records(Records) ->
243243

244244
%% compact-denial-of-existence-07
245245
record_types_for_name(Zone, Name) ->
246-
Labels = dns:dname_to_lower_labels(Name),
246+
Labels = dns_domain:split(dns_domain:to_lower(Name)),
247247
case best_match_at_node(Zone, Labels) of
248248
ent ->
249249
lists:sort([?DNS_TYPE_RRSIG, ?DNS_TYPE_NSEC]);

src/pipes/erldns_questions.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ where `count` is the number of questions removed.
2020
call(#dns_message{qc = 0} = Msg, _) ->
2121
{stop, Msg#dns_message{qr = true}};
2222
call(#dns_message{qc = 1, questions = [#dns_query{name = Name, type = Type}]} = Msg, Opts) ->
23-
Labels = dns:dname_to_lower_labels(Name),
23+
Labels = dns_domain:split(dns_domain:to_lower(Name)),
2424
{Msg, Opts#{query_labels := Labels, query_type := Type}};
2525
call(#dns_message{questions = [Q1 | Rest]} = Msg, #{host := Host} = Opts) ->
26-
Labels = dns:dname_to_lower_labels(Q1#dns_query.name),
26+
Labels = dns_domain:split(dns_domain:to_lower(Q1#dns_query.name)),
2727
Measurements = #{count => length(Rest)},
2828
Metadata = #{host => Host, questions => [Q1 | Rest]},
2929
telemetry:execute([erldns, pipeline, questions], Measurements, Metadata),

src/pipes/erldns_resolver.erl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,12 @@ resolve_exact_match(Message, Zone, QLabels, QType, CnameChain, MatchedRecords) -
255255
resolve_exact_type_match(Message, Zone, QLabels, ?DNS_TYPE_NS, CnameChain, MatchedRecords, []) ->
256256
% There was an exact type match for an NS query, however there is no SOA record for the zone.
257257
?LOG_INFO(
258-
#{what => exact_match_for_ns_with_no_soa, qname => dns:labels_to_dname(QLabels)},
258+
#{what => exact_match_for_ns_with_no_soa, qname => dns_domain:join(QLabels)},
259259
#{domain => [erldns, pipeline]}
260260
),
261261
Answer = lists:last(MatchedRecords),
262262
Name = Answer#dns_rr.name,
263-
Labels = dns:dname_to_labels(Name),
263+
Labels = dns_domain:split(Name),
264264
% It isn't clear what the QTYPE should be on a delegated restart. I assume an A record.
265265
restart_delegated_query(
266266
Message,
@@ -353,7 +353,7 @@ resolve_exact_type_match_delegated(
353353
};
354354
false ->
355355
% NS name is different than the name in the matched records
356-
Labels = dns:dname_to_labels(Name),
356+
Labels = dns_domain:split(Name),
357357
case check_if_parent(Labels, Answer#dns_rr.name) of
358358
true ->
359359
% NS record name is a parent of the answer name
@@ -445,7 +445,7 @@ resolve_exact_match_with_cname(
445445
% No CNAME loop, restart the query with the CNAME content.
446446
CnameRecord = lists:last(CnameRecords),
447447
Name = CnameRecord#dns_rr.data#dns_rrdata_cname.dname,
448-
Labels = dns:dname_to_labels(Name),
448+
Labels = dns_domain:split(Name),
449449
restart_query(
450450
Message#dns_message{
451451
aa = true, answers = Message#dns_message.answers ++ CnameRecords
@@ -622,7 +622,7 @@ resolve_best_match_with_wildcard_cname(
622622
UpdatedMessage = Message#dns_message{
623623
aa = true, answers = Message#dns_message.answers ++ CnameRecords
624624
},
625-
Labels = dns:dname_to_labels(Name),
625+
Labels = dns_domain:split(Name),
626626
restart_query(
627627
UpdatedMessage,
628628
Zone,
@@ -741,7 +741,7 @@ optionally_add_root_hints(Message) ->
741741
check_if_parent(MaybeParent, MaybeChild) when is_list(MaybeParent), is_list(MaybeChild) ->
742742
lists:suffix(MaybeParent, MaybeChild);
743743
check_if_parent(MaybeParent, MaybeChild) when is_binary(MaybeChild) ->
744-
check_if_parent(MaybeParent, dns:dname_to_labels(MaybeChild)).
744+
check_if_parent(MaybeParent, dns_domain:split(MaybeChild)).
745745

746746
%% See if additional processing is necessary.
747747
additional_processing(Message, Zone) ->
@@ -785,18 +785,18 @@ zone_authority_name(#zone{authority = [Record | _]}) ->
785785

786786
% Find NS records that represent a zone cut.
787787
detect_zonecut(Zone, QName) when is_binary(QName) ->
788-
detect_zonecut(Zone, dns:dname_to_labels(QName));
788+
detect_zonecut(Zone, dns_domain:split(QName));
789789
detect_zonecut(Zone, QLabels) when is_list(QLabels) ->
790790
AuthName = zone_authority_name(Zone),
791-
AuthLabels = dns:dname_to_labels(AuthName),
791+
AuthLabels = dns_domain:split(AuthName),
792792
do_detect_zonecut(Zone, AuthLabels, QLabels).
793793

794794
do_detect_zonecut(_, _, []) ->
795795
[];
796796
do_detect_zonecut(_, _, [_]) ->
797797
[];
798798
do_detect_zonecut(Zone, AuthLabels, [_ | ParentLabels] = Labels) ->
799-
case dns:compare_labels(AuthLabels, Labels) of
799+
case dns_domain:are_equal_labels(AuthLabels, Labels) of
800800
true ->
801801
[];
802802
false ->

0 commit comments

Comments
 (0)