Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNSBridge no function clause crash #123

Open
fhunleth opened this issue Aug 28, 2023 · 2 comments
Open

DNSBridge no function clause crash #123

fhunleth opened this issue Aug 28, 2023 · 2 comments

Comments

@fhunleth
Copy link
Member

fhunleth commented Aug 28, 2023

When running with dns_bridge_recursive: true, it's possible to get this crash with a regular DNS lookup:

20:08:46.153 [error] GenServer MdnsLite.DNSBridge terminating
** (FunctionClauseError) no function clause matching in :mdns_lite_inet_dns.encode_res_section/3
    (mdns_lite 0.8.8) src/mdns_lite_inet_dns.erl:303: :mdns_lite_inet_dns.encode_res_section(<<0, 51, 129, 128, 0, 1, 0, 1, 0, 0, 0, 1, 3, 97, 112, 105, 13, 112, 105, 114, 97, 116, 101, 119, 101, 97, 116, 104, 101, 114, 3, 110, 101, 116, 0, 0, 1, 0, 1, 192, 12, 0, 1, 0, 1, 0, 0, 0, 60, 0, ...>>, {3, {["api", "pirateweather", "net"], 12, nil, {["pirateweather", "net"], 16, {["net"], 30, nil, nil}, nil}}}, [{:dns_rr_opt, ~c".", :opt, 512, 0, 0, 0, "", false}])

One fix is to set dns_bridge_recursive: false and avoid the problematic code.

This issue is to track whether to fix dns_bridge_recursive: true or to remove :dns_bridge_recursive completely since the OTP bug that motivated it has been fixed.

@jjcarstens
Copy link
Member

We could just ignore the option and behavior if we detect the OTP version in use is one with the fix?

@fhunleth
Copy link
Member Author

I'm pretty sure you're right. It does seem very desirable to handle this workaround internally and not bother users about it. I just wanted to take a bit of time to refresh my memory on the original issue and OTP DNS resolution before making a PR to remove it.

fhunleth added a commit that referenced this issue Aug 29, 2023
The issue that it works around has been fixed for quite a while (OTP
24.1 and the latest is OTP 26.0). It also looks like there might be a
lingering crash to fix with recursive mode (#123).
fhunleth added a commit that referenced this issue Sep 2, 2023
The issue that it works around has been fixed for quite a while (OTP
24.1 and the latest is OTP 26.0). It also looks like there might be a
lingering crash to fix with recursive mode (#123).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants