openresolv-discuss

Re: openresolv metric logic is flawed

Scott Barker

Wed Nov 14 16:23:44 2018

Thanks for accepting and applying the patch so quickly!

On Tue, Nov 13, 2018 at 03:06:57PM +0000, Roy Marples wrote:
> 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

-- 
Scott Barker

References:
openresolv metric logic is flawedScott Barker
Re: openresolv metric logic is flawedRoy Marples
Archive administrator: postmaster@marples.name