-
Notifications
You must be signed in to change notification settings - Fork 291
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
config: Allow interface names for listener addresses #2623
Conversation
This isn't working for IPv6 link-local addresses.
The listen address must include the zone. For example, this listener works:
There also should be a way to change the port that will be listened on, instead of only supporting the default port. I'm not sure what syntax should be used for this. |
I got this in testing:
Seems fine for ipv4, regarding the warning I do not have an ipv6 address so can't confirm there is an issue with that. |
Yeah, see my comment above. fe80::/10 is a link local network, so that will need the zone appended. Even if you don't have IPv6 connectivity to the internet, your interface is still configured with that link-local address, and dcrd should still listen on it. |
Can confirm I'm no longer getting the ipv6 related warning with the updated PR. |
This is also affecting options like --connect which also use the address normalization, and I'm not sure if we really want that behavior. At the very least, with --connect, if an interface is going to be allowed, it should maybe only use the first address, and not all of them. I'm wondering what others think should be done for these options. |
Yeah for |
113e9bb
to
72e75f0
Compare
For config options which specify listen addresses (such as --listen and --rpclisten), all addresses associated with the interface will be listened on. For config options which specify dialed addresses (such as --addpeer, --connect, --proxy, and --onion), only the first address associated with the interface is included.
This allows RPCs which take hostnames as parameters (such as the 'node' method) to interpret the host part as an interface name, and use the first IP address associated with the interface. This is done for consistency with how interface names may be used in the dcrd application config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've tested the listen and connect functionality works as intended on OpenBSD, Mac, Linux, and Windows.
I also sanity checked the RPC node connect
works as intended on Windows and Linux.
This allows --listen and --rpclisten config options to specify
interface names, instead of only exact IP addresses. If an interface
is named, all IP addresses associated with the interface during config
parsing will be added to the normalized listeners.
Closes #2622.