On 2021/03/06 16:09, Raf Czlonka wrote:
> On Sat, Mar 06, 2021 at 08:59:16AM GMT, Florian Obser wrote:
> > On Sat, Mar 06, 2021 at 06:41:44AM +0000, Adam Steen wrote:
> > > >Synopsis:        dhcpleased does not acquire a lease
> > > >Category:        networking
> > > >Environment:
> > >   System      : OpenBSD 6.9
> > >   Details     : OpenBSD 6.9-beta (GENERIC.MP) #376: Thu Mar  4 21:04:56 
> > > MST 2021
> > >                    
> > > dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> > > 
> > >   Architecture: OpenBSD.amd64
> > >   Machine     : amd64
> > > >Description:
> > >   Testing dhcpleased with a trunk interface and it doesn't acquire a 
> > > lease.
> > > >How-To-Repeat:
> > >   command before new line completed first, then ones after
> > >   terminal 1
> > >           pkill dhcpleased
> > > 
> > >           dhcpleased -dv
> > >           IMSG_OPEN_BPFSOCK
> > >           open_bpfsock: 6
> > >           state_transition Down -> Down, timo: -1
> > >           set_bpfsock: 6 fd: 9
> > >   terminal 2
> > >           ifconfig trunk0 -inet
> > >           ifconfig trunk0
> > >           trunk0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
> > 
> > your interface is not "UP"
> > 
> > >                   lladdr f0:de:f1:77:c2:c8
> > >                   index 6 priority 0 llprio 3
> > >                   trunk: trunkproto failover
> > >                           iwn0 port active
> > >                           em0 port master
> > >                   groups: trunk egress
> > >                   media: Ethernet autoselect
> > >                   status: active
> > > 
> > >           ifconfig trunk0 inet autoconf
> > 
> >     ifconfig trunk0 up
> > 
> > should make it go. There is currently a discussion going on if
> > ifconfig(8) should implicitly bring interfaces up, until that is
> > settled you either need ifconfig $IF up or add "up" to your
> > hostname.if(5) file.
> 
> FWIW, I've made the same mistake thinking that "inet autoconf" and
> "dhcp" are functionally equivalent.

At a very basic level, "inet autoconf" is a signal to something
running in the background and other startup proceeds right away,
whereas "dhcp" is "run a program and wait until either the address
is configured or times out" (which is behaviour some people want).

> I based the assumption both on the commit message[0]:
> 
>       The flag can be set by "ifconfig $if inet autoconf" or by
>       adding "inet autoconf" to /etc/hostname.if. An existing
>       "dhcp" line should be removed.
> 
> i.e. no mention of additional "up"; and the fact that "up" is already
> implied when "dhcp" is being used.
> 
> I can understand both sides to the argument, i.e. on the one hand
> you can configure several interfaces without bringing any of them
> up; or why would you configure an interface if you don't want to
> use it,

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.

>         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.

Reply via email to