Web lists-archives.com

Re: processing order for configuration files in /etc/network/interfaces.d




On Mon, Aug 27, 2018 at 06:41:25PM +0300, Reco wrote:
> Last sentence says to me that wordexp output should be always sorted.

This only tells us that it *reads* the config files in glob-sorted order.
And peeking into the actual source code of ifupdown, yes, it appears to
do this.  (File config.c starting at line 436, in the stretch source.)
It even uses wordexp() as advertised.

What's less clear to me at this moment is what happens *after* the
interface configuration file(s) have been read into memory.

Moving over to main.c, it looks like it reads the interfaces (line 639),
and that function was called from line 1190.  After line 1190, it loops
over the "target_iface" array, and processes them in the order they appear
in that array.

So... next question is how they get packed into that array.

Returning to the select_interfaces function, it looks like the ordering
is created by a call to find_allowup.

And... this is where I stopped reading, because it got confusing.  Maybe
someone else can take a stab at deciphering that part.