3.3 Judging an interface

3.3.1 The facts #

An interface is judged on a snapshot carrying only interface and network facts:

FactValue
Interfacethe kernel's name for the link
Interface.Kindwired, wireless, loopback or other (§4.1)
Interface.Idthe interface id (§4.1)
Interface.Macthe hardware address, when the link has a 6-byte one
Interface.Paththe bus path; absent when sysfs gives none
Interface.Driverthe driver; absent when sysfs gives none
Network.Idthe id of the network identified on the link (§7.1); absent until one is
Network.Namethe record's Name; absent when unset or empty
Network.Trustthe record's Trust; absent when unset or empty
Network.Kindthe interface's kind, once a network is identified; absent before

A fact the interface lacks is absent, which makes a condition on it false, never an error.

3.3.2 When an interface is judged #

Every non-loopback interface is judged on every full pass (§2.2). Loopback is never judged and never managed: it has no verdict, no record under Interfaces\, and netd never changes it.

3.3.3 The verdict #

pnp-core evaluates the forest and netd reads the result:

  • JOIN(i): the profile the forest's ith JOIN names, looked up case-insensitively. netd stands the interface in that profile.
  • DOWN: the interface is kept administratively down.
  • anything else, including the backstop: IGNORE.

The attribution is the evaluation's: the path of the rule that spoke, or backstop when none did.

3.3.4 Conflicts #

When the evaluation reports a conflict — the highest-priority candidates tie and name different profiles — netd does not choose. The interface's outcome is IGNORE, its attribution is the tied rules' paths, sorted and joined with vs, and its warning is rules <a> vs <b> tie; the interface is ignored. The first time an interface meets a conflict, netd logs a warning.

A conflict reaches an interface in two ways. A generation taken at startup is not checked for ties (§2.1), and an interface that appears after a generation was taken is judged against it with no check. A generation built at runtime that ties on an interface already present is refused instead (§3.2).

3.3.5 A change of verdict #

The outcome compares the verdict and the profile's resolved values. When either differs from the interface's previous outcome, netd logs the new verdict and its rule, and stops the interface's clients:

  • the DHCPv4 client sends a RELEASE if it holds a lease (§5.4) and is discarded, along with its lease and any link-local address;
  • router discovery and DHCPv6 are discarded, and their addresses go at the next reconcile.

The pass then starts whatever clients the new outcome wants. Editing any value of the profile an interface stands in is a change of outcome, so it restarts the interface's clients against the new profile, rather than trusting a lease obtained under the old one.

3.3.6 What each verdict does #

VerdictClientsDesired state (§4.2)
JOIN(profile)started as the profile asksup, with the profile's addresses and routes
DOWNnonedown, carrying no addresses and no netd routes
IGNOREnonenone: netd plans nothing for the interface

An IGNOREd interface is left exactly as it is. If it was joined before, the addresses and routes netd gave it stay where they are, because nothing desires their removal.

Edit this page