Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Network: Allow to listen on virtual interfaces.
Previously when trying to listen on virtual interfaces during bootstrap the application would stop working - the interface couldn't be found by the NetworkUtils class. The NetworkUtils utilize the underlying JDK NetworkInterface class which, when asked to lookup by name only takes physical interfaces into account, failing at virtual (or subinterfaces) ones (returning null). Note that when interating over all interfaces, both physical and virtual ones are taken into account. This changeset asks for all known interfaces, iterates over them and matches on the given name as part of the loop, allowing it to catch both physical and virtual interfaces. As a result, elasticsearch can now also serve on virtual interfaces. A test case has been added which makes sure that all iterable interfaces can be found by their respective name. Note that this PR is a second iteration over the previously merged but later reverted elastic#19537 because it causes tests to fail when interfaces are down. The test has been modified to take this into account now. Closes elastic#17473 Relates elastic#19537
- Loading branch information