-
Notifications
You must be signed in to change notification settings - Fork 97
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
Problem cross-compiling for MIPS router support #124
Comments
Possibly it is an issue with your As a quick test, on the working arm7l box generate a
and then use that JSON-like config on the MIPS box (
Disclaimer: never tried this, but should work. If that works your |
Tried it exporting both the default config and a running config. Trying to start on the MIPS box fails with both, printing out the JSON config and ending with EDIT: Sorry I forgot to say THANKS for the quick response! |
Also wanted to mention I tried downleveling both getdns and libyaml to the next to last releases with the same result. |
getdns-1.4.2 has an import parsing bugfix. Note the Possibly a stubby developer @wtoorop has an idea. |
Currently running getdns-1.4.2 and libyaml-0.2.1 Since the built in default Opportunistic config fails the same way, I have the feeling it's something basic if we could narrow it down. Possibly something in the ancient MIPS kernel is causing a problem (can't update the kernel since it's tied to the SDK for hardware). If stubby isn't setting the return code, the return code 55 (NO ANODE) would seem to point that way. If we could figure out what was wrong, I might be able to backport the required fixes to the kernel. |
If the default config is failing then it is probably something fundamental in the internal JSON parsing (the default config uses JSON not YAML). The default config looks like this:
You can save this to a file with a .conf extension and use this on the command line. In theory you should be able to use a single line file with just the listen address in, so you could strip out each extra line and see if you see any difference.... pretty empirical at this point but maybe worth a try. (Apologies our error reporting is so poor here...) I could try to provide a patch to improve the error reporting? I would be interested to know if getdns_query works - the initialisation is slightly different to stubby? |
Thanks for the help. Your test suggestions I think verified what I was thinking that the error message was misleading. I went down to your single line conf with the following results.
Nothing should exist on the listen addresses. |
Well, now I'm confused again. I added some diagnostic prints in the add_listeners routine in server.c, and none of the error checks tripped. Is there another place that I missed? |
I suspect the error is hit in the getdns_context_set_listen_addresses() routine before it calls add_listeners. |
After installing strace and adding some more diagnostic code, I agree. In fact, it seems as if most(all?) of the getdns_context functions are failing. This is why the results are so varied depending on the contents of the yml/conf file. I'm just starting to dig further, but it seems as if there are two things unique to these functions
Did you possibly run into anything here with respect to other platform support that might give me a further clue? Thanks again for your help. |
Sorry about the inadvertent close....definitely still working the issue. |
@john9527 What you are seeing does seem odd indeed. I'm not aware of any other platform we have run into these problems with but @wtoorop might know more.... As for the memory functions, the original API specification included the use of custom memory management functions so the implementation is such that it uses malloc, etc. as the default functions. |
Found it! getaddrinfo is broken in some linux releases. Usually, this is addressed via an m4 macro, but the version in your distribution doesn't check for linux release dependancies. I would like to suggest you look at the m4 macros packaged with wget which I know handle it properly. getaddrinfo is called in two places in stubby, context.c and server.c Thanks again for taking the time to respond. |
Just thought I'd pass on that I have formally released the DoT/Stubby support on my Asuswrt-Merlin LTS fork. You can see the user interface I provide here... |
uClibc 0.9.30rc1 - 0.9.32rc5 has bug - getaddrinfo() does not accept numeric service without any hints. As the related side effect, hint struct with ai_socktype == 0 (unspec) and ai_protocol == 0 (unpsec) gives the same EAI_SERVICE error instead of same address with different proto enumebration. For more details please refer https://bugs.busybox.net/show_bug.cgi?id=3841 and https://git.uclibc.org/uClibc/commit/?id=bc3be18145e4d57e7268506f123c0f0f373a15e2 Since 0.9.3x uClibc versions are still not somewhat unique in embedded (issue getdnsapi/stubby#124 as example) and non-zero ai_socktype allows to avoid address dups for each supported UDP/TCP/etc proto, seems worth to have it specified, as a minor memory allocation optimization at least. SOCK_DGRAM vs SOCK_STREAM choice doesn't really matter here, both are actually used for DNS and both are non-zero, no difference is expected on *nix. So SOCK_DGRAM selected due original comment only.
Closing - thanks again for this work! |
I currently maintain a fork of Asuswrt-Merlin firmware for ASUS routers.
https://github.com/john9527/asuswrt-merlin
I am trying to integrate getdns/stubby support. I have successfully built for arm7l based routers, which use a customized kernel 2.6.36.4....it's working very well.
However, trying to build for MIPS routers using a kernel based on 2.6.22.19, I can successfully build/compile, but there are problems running the executable. Here's some basic info on what I am seeing. The same yml config runs fine on the ARM routers (I dynamically generate it in the router firmware). The return code is rather interesting. Any ideas?
The text was updated successfully, but these errors were encountered: