openresolv-discuss

Re: openresolv metric logic is flawed

Roy Marples

Tue Nov 13 15:06:38 2018

On 13/11/2018 00:44, Scott Barker wrote:
The documentation for the -m options says:

Set the metric of the interface when adding it, default of 0.  Lower
metrics take precedence.

However, if you assign any metric to an interface, it will actually
take precedence over any interface which doesn't have a metric
defined and isn't in the interface_order or dynamic_order. Hence, the
default metric is actually one more than 9999999. For example:

# /sbin/resolvconf -i lo.unbound wlan0

# cat myvpn_resolvconf | /sbin/resolvconf -m 99 -a myvpn

# /sbin/resolvconf -i lo.unbound myvpn wlan0

# find /run/resolvconf/ -type f /run/resolvconf/interfaces/myvpn /run/resolvconf/interfaces/lo.unbound /run/resolvconf/interfaces/wlan0 /run/resolvconf/metrics/0000099
myvpn

I've attached a trivial patch that fixes this behaviour.

Applied here:
https://roy.marples.name/git/openresolv.git/commit/?id=901c2bf7910802ccbe79d7c9670c41137436aa98

Thanks!

Roy

Follow-Ups:
Re: openresolv metric logic is flawedScott Barker
References:
openresolv metric logic is flawedScott Barker
Archive administrator: postmaster@marples.name