On 2021/03/06 10:46, Theo de Raadt wrote: > Mark Kettenis <[email protected]> wrote: > > > > Date: Sat, 6 Mar 2021 16:47:26 +0000 > > > From: Stuart Henderson <[email protected]> > > > > > > there's the case of "don't want to use it _yet_", for example you might > > > want to setup umb ready for use but only bring it up manually when > > > needed, or you might want to setup pppoe and don't want it to start > > > trying to connect immediately at the point it processes "inet" but > > > wait until you've sent all of the configuration commands. > > > > Right. I have a few machines where I have wireless interfaces that I > > configure with a nwid and wpakey such that I can bring them up with a > > simple "ifconfig bwfm0 up" and deliberately don't bring them up > > automatically. > > > > > > not to mention one command less to run or one less option > > > > to use in hostname.if(5), on the other. > > > > > > For the hostname.if case, it's easy enough, netstart could do "up" > > > automatically after configuring if there is no "down" in the file. > > > > That would break my configurations. > > If we are going to do something, it should just be for > > 'address has been configured' > > which would include a static ipv4, or static ipv6, or dynamic ipv6, > or dynamic ipv4. > > so, bring those up.
For dynamic, the interface needs to be up anyway, so in that case it's "we expect an address to be configured". > If the (tail of) the hostname.if file contains "down", it would come up > and quickly go back down. The little flip should not hurt anyone. We already rely on a hack to make pppoe work reliably, there is a race due to auto-up. dest ought to be configured before the interface is brought up otherwise we try to negotiate with the ISP before pppoe knows what the destination address should be or whether it should be a wildcard. The trick is to use "inet 0.0.0.0 255.255.255.255 0.0.0.1" which relies on the fact that "dest" for a point-point interface is stored in the same place as the broadcast address. So, for pppoe it doesn't hurt as long as you know the trick, but it is an example of a (minor) problem with the "auto up on address config". > The question is where do we do this "up" operation. inside netstart? > Inside ifconfig? Maybe in the return-side of the ioctl code that sets > addresses? I think any change to this is going to improve some use cases and make others worse..
