Incorrect upstream interface
another issue with `guess_interface_from_ip()` (see also #11519):
`services_dhcrelay_configure()` uses `guess_interface_from_ip()` which returns only first (top-down) interface from the `route_get($ipaddress)` output (which is slow, see #11475)
How to reproduce:
1) LAN (vtnet0) - 192.168.88.41/24
2) Create OpenVPN p2p instance with remote network 192.168.0.0/16;
3) Configure DHCP Relay with 192.168.88.99 destination server
now `guess_interface_from_ip("192.168.88.99")` returns 'ovpns1', cause it first in the `netstat -rn` output:
# netstat -rn | grep 192.168. 192.168.0.0/16 10.78.78.2 UGS ovpns2 192.168.88.0/24 link#1 U vtnet0 192.168.88.41 link#1 UHS lo0
Feb 24 17:02:42 pf41 php-fpm: /services_dhcp_relay.php: No suitable upstream interfaces found for running dhcrelay!
Updated by Viktor Gurov 8 months ago
Updated by Jim Pingle 8 months ago
Feels to me like
guess_interface_from_ip() if it keeps using the full routing table would need to be changed so it finds the longest match instead of the first match, but given the other behavior going back to using
route -n get is going to be much faster than parsing the whole table in PHP.