tungd / elixir-dns

DNS library for Elixir
BSD 3-Clause "New" or "Revised" License
114 stars 37 forks source link

Server part is broken on Erlang 24.2 #41

Closed salseeg closed 2 years ago

salseeg commented 2 years ago

Calling :inet_dns.decode results different dns_query structure

Erlang 24.1.2

iex(1)> :inet_dns.decode(<<94, 236, 1, 32, 0, 1, 0, 0, 0, 0, 0, 1, 6, 110, 101, 114, 118, 101, 115, 5, 108, 111, 99, 97, 108, 0, 0, 1, 0, 1, 0, 0, 41, 16, 0, 0, 0, 0, 0, 0, 0>>)
{:ok,
 {:dns_rec,
  {:dns_header, 24300, false, :query, false, false, true, false, false, 0},
  [{:dns_query, 'nerves.local', :a, :in}], [], [],
  [{:dns_rr_opt, '.', :opt, 4096, 0, 0, 0, ""}]}}

Erlang 24.2.1

iex(1)> :inet_dns.decode(<<94, 236, 1, 32, 0, 1, 0, 0, 0, 0, 0, 1, 6, 110, 101, 114, 118, 101, 115, 5, 108, 111, 99, 97, 108, 0, 0, 1, 0, 1, 0, 0, 41, 16, 0, 0, 0, 0, 0, 0, 0>>)
{:ok,
 {:dns_rec,
  {:dns_header, 24300, false, :query, false, false, true, false, false, 0},
  [{:dns_query, 'nerves.local', :a, :in, false}], [], [],
  [{:dns_rr_opt, '.', :opt, 4096, 0, 0, 0, ""}]}}

Notice false as 5th element of a tupple

salseeg commented 2 years ago

It is mDNS support added - https://github.com/erlang/otp/blob/master/lib/kernel/src/inet_dns.hrl#L220

salseeg commented 2 years ago

Full rebuild solved an issue