diff options
author | Alexander Clouter <alex@digriz.org.uk> | 2021-01-05 13:24:24 +0000 |
---|---|---|
committer | Alexander Clouter <alex@digriz.org.uk> | 2021-01-13 08:03:14 +0000 |
commit | fc48515df428c27cc0efe5bc2d1956099139d04b (patch) | |
tree | 0dfaf3b511dc5d9be9fb912f35b5d55888a4f632 /lib/kernel/src/inet_dns.erl | |
parent | cf75b59c332b36dc6086dad20cad8cbbbc1dc57a (diff) | |
download | erlang-fc48515df428c27cc0efe5bc2d1956099139d04b.tar.gz |
inet_res: fix label compression encoder for large responses
The pointer in the label is only 14bit wide and a typo incorrectly uses the
0b11 (3) flag meaning the limit of 49152 is used instead of 16384.
Diffstat (limited to 'lib/kernel/src/inet_dns.erl')
-rw-r--r-- | lib/kernel/src/inet_dns.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/kernel/src/inet_dns.erl b/lib/kernel/src/inet_dns.erl index e03f124fe6..18103771dc 100644 --- a/lib/kernel/src/inet_dns.erl +++ b/lib/kernel/src/inet_dns.erl @@ -697,7 +697,7 @@ encode_labels(Bin, Comp0, Pos, [L|Ls]=Labels) when 1 =< byte_size(L), byte_size(L) =< 63 -> case gb_trees:lookup(Labels, Comp0) of none -> - Comp = if Pos < (3 bsl 14) -> + Comp = if Pos < (1 bsl 14) -> %% Just in case - compression %% pointers cannot reach further gb_trees:insert(Labels, Pos, Comp0); |