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
wireguard-tools: Add netifd protocol helper #3514
Conversation
Signed-off-by: Dan Luedtke <mail@danrl.com>
Looks good to me! |
Merged, thanks! |
Thank you very much! |
Can you make proto_add_host_dependency work again? What issue were you facing with v6? It works quite well with v4. |
I'd love to, but it doesn't work reliably. I asked at the openwrt and lede mailing lists for advice. No response so far. |
What goes wrong specifically? |
What happened in my tests is, that the interface did not came up, because the |
So it seems like the solution, then, is for resolveip to use getaddrinfo's AI_ADDRCONFIG flag, so that it only returns v4 IPs if there's an interface with a v4 address and v6 IPs if there's an interface with a v6 address. |
Maybe better to s/if there is an interface with/if there is a default route for $ip_version/, but yes, that's the basic idea. I wish proto_add_host_dependency would just accept hostnames and do the resolving. Would remove clutter from many scripts, not only wireguard.sh |
Well here, instead of having to patch resolveip, there's actually a more robust way of doing this: |
I don't think it is a good idea for protocol helper scripts to implement features that are available via netifd. I will run another test when the code hits the snapshots. Was away from my lab the whole week, so testing capabilites were limited. |
That's fair. I guess if you're not getting any responses on the mailing list about the issue, you could just submit a patch for netifd that fixes it in the way you see being most straightforward. At least on LKML, I've found this to be an effective strategy. Either I did it correctly, and people are happy and merge it, or it's wrong, in which case people start chiming in with a view of how they'd like to see things. |
Maintainer: @zorun
Run tested: x86, latest snapshot
Description: Adds netifd protocol helper for WireGuard, which is used by luci-proto-wireguard.
Signed-off-by: Dan Luedtke mail@danrl.com