Re: lladdr support for netstart/hostname.if

2022-12-05 Thread Theo de Raadt
It is time. ok deraadt There is a man page change we've discussed which can also go in, after that I expect jmc will get involved and change it a little. Andrew and I have had another discussion about how the installer might provide a way in the installer to create these files instead (no new qu

Re: lladdr support for netstart/hostname.if

2022-12-03 Thread Klemens Nanni
On Thu, Dec 01, 2022 at 06:53:30PM -0800, Andrew Hewus Fresh wrote: > How about this adjustment to the man page? Reads fine, although it doesn't explain which file type wins. > > Index: share/man/man5/hostname.if.5 > === > RCS file:

Re: lladdr support for netstart/hostname.if

2022-12-01 Thread Andrew Hewus Fresh
How about this adjustment to the man page? Index: share/man/man5/hostname.if.5 === RCS file: /cvs/src/share/man/man5/hostname.if.5,v retrieving revision 1.79 diff -u -p -r1.79 hostname.if.5 --- share/man/man5/hostname.if.526 J

Re: lladdr support for netstart/hostname.if

2022-11-26 Thread Klemens Nanni
On Sat, Nov 26, 2022 at 03:23:03PM -0800, Andrew Hewus Fresh wrote: > On Sat, Nov 26, 2022 at 07:12:12PM +, Klemens Nanni wrote: > > On Sat, Nov 26, 2022 at 10:44:05AM -0800, Andrew Hewus Fresh wrote: > > > I think this is the complete diff, with the man page bits mostly from > > > Martijn. N

Re: lladdr support for netstart/hostname.if

2022-11-26 Thread Andrew Hewus Fresh
On Sat, Nov 26, 2022 at 07:12:12PM +, Klemens Nanni wrote: > On Sat, Nov 26, 2022 at 10:44:05AM -0800, Andrew Hewus Fresh wrote: > > I think this is the complete diff, with the man page bits mostly from > > Martijn. Now that the ifconfig -M bits are in, this should be easier > > to test. I w

Re: lladdr support for netstart/hostname.if

2022-11-26 Thread Klemens Nanni
On Sat, Nov 26, 2022 at 10:44:05AM -0800, Andrew Hewus Fresh wrote: > I think this is the complete diff, with the man page bits mostly from > Martijn. Now that the ifconfig -M bits are in, this should be easier > to test. I was able to test the installer bits, and they worked for me. This reads

Re: lladdr support for netstart/hostname.if

2022-11-26 Thread Andrew Hewus Fresh
I think this is the complete diff, with the man page bits mostly from Martijn. Now that the ifconfig -M bits are in, this should be easier to test. I was able to test the installer bits, and they worked for me. Index: etc/netstart

Re: lladdr support for netstart/hostname.if

2022-11-24 Thread Theo de Raadt
Andrew spotted a potential issue with the short-circuit ordering, so here is a newer diff. Index: ifconfig.8 === RCS file: /cvs/src/sbin/ifconfig/ifconfig.8,v retrieving revision 1.385 diff -u -p -u -r1.385 ifconfig.8 --- ifconfig.8

Re: lladdr support for netstart/hostname.if

2022-11-24 Thread Andrew Hewus Fresh
I think this is the bits the installer needs. I might adjust /etc/netstart to use this glob or this to use *:*, still thinking on it. It's a bit simpler because I figured the installer could be quieter so I could just return instead of printing errors first. I haven't tested this yet. We'll see

Re: lladdr support for netstart/hostname.if

2022-11-24 Thread Theo de Raadt
Theo de Raadt wrote: > Vitaliy Makkoveev wrote: > > > > On 24 Nov 2022, at 19:20, Theo de Raadt wrote: > > > > > >> I like to exclude pseudo devices. The pseudo device list is immutable, > > >> so we need to get only once during /etc/netstart. > > > > > > Why do we need to excluse them? > >

Re: lladdr support for netstart/hostname.if

2022-11-24 Thread Theo de Raadt
How about if ifconfig -M skips devices that are IFXF_CLONED? That lookup might not be atomic (I don't think xflags is in the ifaddrs list), but I don't think atomicity matters. Then the hostname.MAC will always work on the underlying physical device. Or is there another way to identify overlay

Re: lladdr support for netstart/hostname.if

2022-11-24 Thread Theo de Raadt
Vitaliy Makkoveev wrote: > > On 24 Nov 2022, at 19:20, Theo de Raadt wrote: > > > >> I like to exclude pseudo devices. The pseudo device list is immutable, > >> so we need to get only once during /etc/netstart. > > > > Why do we need to excluse them? > > > > The users will learn when to use t

Re: lladdr support for netstart/hostname.if

2022-11-24 Thread Vitaliy Makkoveev
> On 24 Nov 2022, at 19:20, Theo de Raadt wrote: > >> I like to exclude pseudo devices. The pseudo device list is immutable, >> so we need to get only once during /etc/netstart. > > Why do we need to excluse them? > > The users will learn when to use this, and when not to. > So, I can't use h

Re: lladdr support for netstart/hostname.if

2022-11-24 Thread Theo de Raadt
> I like to exclude pseudo devices. The pseudo device list is immutable, > so we need to get only once during /etc/netstart. Why do we need to excluse them? The users will learn when to use this, and when not to.

Re: lladdr support for netstart/hostname.if

2022-11-24 Thread Vitaliy Makkoveev
On Thu, Nov 24, 2022 at 01:34:30PM +, Stuart Henderson wrote: > 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 wrote: > > > > > > > > The other, that if both exist, > > > > > /etc/hostname.$if will override

Re: lladdr support for netstart/hostname.if

2022-11-24 Thread Stuart Henderson
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 wrote: > > > > > > The other, that if both exist, > > > > /etc/hostname.$if will override /etc/hostname.$lladdr. > > > > > > We do need to decide which one is priority

Re: lladdr support for netstart/hostname.if

2022-11-24 Thread Vitaliy Makkoveev
On Wed, Nov 23, 2022 at 09:36:28PM -0700, Theo de Raadt wrote: > Theo de Raadt 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 bet

Re: lladdr support for netstart/hostname.if

2022-11-23 Thread Theo de Raadt
Theo de Raadt 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

Re: lladdr support for netstart/hostname.if

2022-11-23 Thread Theo de Raadt
> 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

Re: lladdr support for netstart/hostname.if

2022-11-23 Thread Andrew Hewus Fresh
On Wed, Nov 23, 2022 at 05:28:35PM -0800, Andrew Hewus Fresh wrote: > On Tue, Nov 22, 2022 at 08:09:11AM -0700, Theo de Raadt wrote: > > Florian Obser wrote: > > > ifconfig(8) already knows about these (see -C option). Which made me > > > think, it might be easier to just ask ifconfig(8). > > >

Re: lladdr support for netstart/hostname.if

2022-11-23 Thread Andrew Hewus Fresh
On Tue, Nov 22, 2022 at 08:09:11AM -0700, Theo de Raadt wrote: > Florian Obser wrote: > > ifconfig(8) already knows about these (see -C option). Which made me > > think, it might be easier to just ask ifconfig(8). > > I've done it as -M With `ifconfig -M $lladdr` support, and ignoring the check

Re: lladdr support for netstart/hostname.if

2022-11-22 Thread Martijn van Duren
On Tue, 2022-11-22 at 11:25 +0100, Claudio Jeker wrote: > On Tue, Nov 22, 2022 at 09:25:08AM +, Stuart Henderson wrote: > > Need to query (and set $if, which might be used in route commands etc) I > > think. > > > > I would prefer if people took a step back from configuring interfaces by > M

Re: lladdr support for netstart/hostname.if

2022-11-22 Thread Andrew Hewus Fresh
On Tue, Nov 22, 2022 at 03:37:20PM +, Klemens Nanni wrote: > On Tue, Nov 22, 2022 at 08:09:11AM -0700, Theo de Raadt wrote: > > Florian Obser wrote: > > > ifconfig(8) already knows about these (see -C option). Which made me > > > think, it might be easier to just ask ifconfig(8). > > > > > >

Re: lladdr support for netstart/hostname.if

2022-11-22 Thread Klemens Nanni
On Tue, Nov 22, 2022 at 08:09:11AM -0700, Theo de Raadt wrote: > Florian Obser wrote: > > > On 2022-11-22 18:06 +10, David Gwynne wrote: > > > > > > There are a few things to keep in mind if we're going to use lladdrs like > > > this. > > > > > > vlan interfaces start with their lladdr as 00:00

Re: lladdr support for netstart/hostname.if

2022-11-22 Thread Theo de Raadt
Florian Obser wrote: > On 2022-11-22 18:06 +10, David Gwynne wrote: > > > > There are a few things to keep in mind if we're going to use lladdrs like > > this. > > > > vlan interfaces start with their lladdr as 00:00:00:00:00:00 and then > > assume the lladdr of the parent interface when that

Re: lladdr support for netstart/hostname.if

2022-11-22 Thread Vitaliy Makkoveev
On Tue, Nov 22, 2022 at 06:28:31AM -0700, Theo de Raadt wrote: > Vitaliy Makkoveev wrote: > > > On Tue, Nov 22, 2022 at 11:25:55AM +0100, Claudio Jeker wrote: > > > On Tue, Nov 22, 2022 at 09:25:08AM +, Stuart Henderson wrote: > > > > Need to query (and set $if, which might be used in route c

Re: lladdr support for netstart/hostname.if

2022-11-22 Thread Theo de Raadt
Vitaliy Makkoveev wrote: > As dlg@ pointed, we have collisions with clonable devices, which inherit > lladdr or could generate already existing lladdr. We need to handle > this, for example exclude clobable devices from hostname.lladdr logic. Noone is proposing deleting the existing support for

Re: lladdr support for netstart/hostname.if

2022-11-22 Thread Theo de Raadt
Claudio Jeker wrote: > On Tue, Nov 22, 2022 at 09:25:08AM +, Stuart Henderson wrote: > > Need to query (and set $if, which might be used in route commands etc) I > > think. > > > > I would prefer if people took a step back from configuring interfaces by > MAC address. It feels like a overl

Re: lladdr support for netstart/hostname.if (was: Re: Locking network card configuration)

2022-11-22 Thread Theo de Raadt
Miod Vallat wrote: > I'm a bit late to the thread, but whatever its outcome, things have to > work correctly on older sparc64 hardware, where the default behaviour > for on-board and Sun-branded expansion card interfaces is to use the > same MAC address. > > This hints that hostname. should have

Re: lladdr support for netstart/hostname.if

2022-11-22 Thread Theo de Raadt
Vitaliy Makkoveev wrote: > On Tue, Nov 22, 2022 at 11:25:55AM +0100, Claudio Jeker wrote: > > On Tue, Nov 22, 2022 at 09:25:08AM +, Stuart Henderson wrote: > > > Need to query (and set $if, which might be used in route commands etc) I > > > think. > > > > > > > I would prefer if people too

Re: lladdr support for netstart/hostname.if

2022-11-22 Thread Theo de Raadt
Claudio Jeker wrote: > Not all interfaces have MAC addresses. E.g. umb(4) would need a > different identifier (most probably the IMEI). Some interfaces inherit > the MAC address from an other interface (vlan, trunk). Then don't use hostname.MAC for those interfaces. The other mechanism will re

Re: lladdr support for netstart/hostname.if (was: Re: Locking network card configuration)

2022-11-22 Thread Miod Vallat
I'm a bit late to the thread, but whatever its outcome, things have to work correctly on older sparc64 hardware, where the default behaviour for on-board and Sun-branded expansion card interfaces is to use the same MAC address. This hints that hostname. should have priority over hoshname. for the

Re: lladdr support for netstart/hostname.if

2022-11-22 Thread Vitaliy Makkoveev
On Tue, Nov 22, 2022 at 11:25:55AM +0100, Claudio Jeker wrote: > On Tue, Nov 22, 2022 at 09:25:08AM +, Stuart Henderson wrote: > > Need to query (and set $if, which might be used in route commands etc) I > > think. > > > > I would prefer if people took a step back from configuring interfaces

Re: lladdr support for netstart/hostname.if

2022-11-22 Thread Claudio Jeker
On Tue, Nov 22, 2022 at 09:25:08AM +, Stuart Henderson wrote: > Need to query (and set $if, which might be used in route commands etc) I > think. > I would prefer if people took a step back from configuring interfaces by MAC address. It feels like a overly specific hack is introduced for a c

Re: lladdr support for netstart/hostname.if

2022-11-22 Thread Stuart Henderson
Need to query (and set $if, which might be used in route commands etc) I think. -- Sent from a phone, apologies for poor formatting. On 22 November 2022 08:37:05 Florian Obser wrote: On 2022-11-22 18:06 +10, David Gwynne wrote: There are a few things to keep in mind if we're going to use

Re: lladdr support for netstart/hostname.if

2022-11-22 Thread Florian Obser
On 2022-11-22 18:06 +10, David Gwynne wrote: > > There are a few things to keep in mind if we're going to use lladdrs like > this. > > vlan interfaces start with their lladdr as 00:00:00:00:00:00 and then assume > the lladdr of the parent interface when that is configured. > > Clonable devices (

Re: lladdr support for netstart/hostname.if (was: Re: Locking network card configuration)

2022-11-22 Thread David Gwynne
> On 22 Nov 2022, at 16:13, Andrew Hewus Fresh wrote: > > On Mon, Nov 21, 2022 at 04:56:07PM +0100, Martijn van Duren wrote: >> On Sun, 2022-11-20 at 19:35 -0700, Theo de Raadt wrote: >>> Steve Litt wrote: >>> Vitaliy Makkoveev said on Mon, 21 Nov 2022 03:48:21 +0300 >> On 20

Re: lladdr support for netstart/hostname.if (was: Re: Locking network card configuration)

2022-11-21 Thread Andrew Hewus Fresh
On Mon, Nov 21, 2022 at 04:56:07PM +0100, Martijn van Duren wrote: > On Sun, 2022-11-20 at 19:35 -0700, Theo de Raadt wrote: > > Steve Litt wrote: > > > > > Vitaliy Makkoveev said on Mon, 21 Nov 2022 03:48:21 +0300 > > > > > > > > On 20 Nov 2022, at 18:06, Odd Martin Baanrud > > > > > wrote: >