remote static: Clean up autodetect behavior?
I wonder if stprov remote static
's autodetect behavior should be cleaned up a bit. It looks like we have both a "smart" and a "dumb" autoselect:
- first the smart autoselect goes over all interfaces and tries to figure out if it is able to find one where it can ping the gateway. Nice!
- if that fails, resort to just selecting the first default interface (AKA IFF_UP and IFF_RUNNING)
The reason why I think this stands out: if we already know the interface will not work as expected (i.e., it is not possible to communicate with the gateway); then it is probably more helpful to just fail earlier with an error message.