On 2022/11/24 14:36, Vitaliy Makkoveev wrote: > On Wed, Nov 23, 2022 at 09:36:28PM -0700, Theo de Raadt wrote: > > Theo de Raadt <dera...@openbsd.org> wrote: > > > > > > The other, that if both exist, > > > > /etc/hostname.$if will override /etc/hostname.$lladdr. > > > > > > We do need to decide which one is priority, and document that. > > > > > > I am still unsure which is better. (I've seen a lot of spurious comments > > > from folk, so please think about realistic cases, and don't make stuff > > > up..) > > > > And by that I mean: Actually try andrews's diff. It does it one way (.if > > is more important). Maybe it needs to be the other way. > > > > Could we check the simultaneous existence of both hostname.if and > hostname.lladdr corresponding to one interface and print error message > if so? > > I'm also interesting how the following case will be handled. We have > /etc/hostname.vlan0 and /etc/hostname.08002233ccbb, network devices > configured as:
I don't see how this scheme can work with vlans (or any interface which changes its MAC address, whether that's automatically - vlan, trunk - randomly - vether, etc - or explicitly with lladdr). Another thing with vlans is that, they have a 00:00:00:00:00:00 MAC address until they're configured, but if you then later re-run netstart, they then *will* have a MAC address (matching a physical interface), so netstart's behaviour will be different between running at boot, and running later. That's not really a problem as such, it just limits the scope of where this functionality could be used. (It wouldn't really help vlans anyway - the thing which needs changing for those is picking which parent interface to use, not picking a different hostname file for the vlan interface).