On Mon, Nov 15, 2021 at 12:23:02PM +0000, Klemens Nanni wrote:
> On Mon, Nov 15, 2021 at 12:00:18PM +1000, David Gwynne wrote:
> > On Sat, Nov 13, 2021 at 11:59:59PM +0000, Klemens Nanni wrote:
> > > Practically all interfaces pull itself up when IPs get assigned, but
> > > vport(4) does not.
> > 
> > Yes, I do (or don't do) this very deliberately when I get the chance.
> > 
> > > This broke IPv4 networking for me on a router I switched from bridge(4)
> > > to veb(4) because hostname.vport0 only contained the equivalent of
> > > 
> > >   descr LAN
> > >   inet 192.0.2.1
> > >   inet6 2001:db8::1
> > > 
> > > e.g. the explicit "up" was missing.
> > > 
> > > dhcpd(8) only considers UP interfaces to listen on during start;
> > > being the only interface it could potentially listen on, dhcpd thus
> > > ignored vport0 and failed to start.
> > > 
> > > `ifconfig vport0 up && rcctl restart dhcpd' fixed this.
> > > Adding "up" to thostname.vport0 also fixed it.
> > > 
> > > Nonetheless, vport should UP itself as the rest does.
> > 
> > My counter argument is that no interface should implicitly bring itself
> > up when an address is configured because it has been a road block to
> > figuring out how to lock the ioctl paths better, and it confuses error
> > handling. If address config works, but the interface fails to come up,
> > the address remains configured but we report an error. But it looks like
> > configuring an address failed? Wat.
> 
> That's a valid point, although I must say I never ran into this issue.
> 
> I fear that users have come to rely on the implicit up semantics, i.e.
> I doubt I'm the only one with hostname.* files lacking "up".

Sure people got used to this mode. I agree with dlg@ that the way that
this auto interface up happens is rather horrible from a network stack
view. Also it makes it impossible to configure an interface all the way
before bringing it up. This may be important for interfaces with more
complex configuration.

The current behaviour is great for casual users (that does not really
care about network) but is annoying for network admins.
 
> > I've suggested previously that netstart should handle bringing an
> > interface up. look for "netstart: implicit up and explicit down for
> > hostname.if conf files" on tech@. I didn't hanve the energy to push
> > it forward though.
> 
> I'll do the digging and try to catch up, thanks.

Another option is to adjust ifconfig but then again one would like to do
the up last after running multiple ifconfig calls. ifconfig has its own
madness when it comes to execute multiple commands in one go.
 
> > dhcpd should cope with an interface being down too. It should be about
> > whetherthe addresses are right more than if the interface is up or not.

I expect an interface that is down to remain down until I bring it up
again. Same goes the other way. ifconfig up/down should only be used to
implement admin shutdown. We fixed a few interfaces in the past that
played with IFF_UP in the driver.

-- 
:wq Claudio

Reply via email to