Commit graph

8 commits

Author SHA1 Message Date
Raito Bezarius
ebcdbf76bc fix(bridge): members are now granular services
They are still part of the bundle, but we can wait on each of them
independently now.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-05 14:54:12 +02:00
Raito Bezarius
1bd9af1e9d fix(bridge): reorder initialization for bridge dependents
Some checks failed
build liminix / build_vm_qemu_mips (push) Failing after 27s
Consider the scenario where you run DHCPv4 on the primary bridge
interface.

You have no real interface to "wait upon", so it's OK. Nonetheless,
anything depending on successful completion of DHCPv4, e.g. adding a
default route, will block `s6-rc -v2 up change default`.

The way new interfaces are attached to the bridge is via `s6-rc -b -u
change $attach-oneshot-service`, this introduce in turn a deadlock.

At some point, DHCPv4 will timeout, unblocking the deadlock and
attaching the members to the primary bridge interface, making it ready
to send L2 broadcast packets for DHCP, unblocking DHCP in turn again.

This is not satisfying because we really want to have a no-hiccups
bring-up.

To fix this, we proceed to multiple changes:

- we remove `svc.ifwait.build` out of band `s6-rc -b -u $oneshot-attach`
  call, which is, by design, wrong here.
- users can now depend on the members service to know when a bridge is
  fully operational (we could make it more granular and let them depend
  on the LAN member joining rather than WLAN, etc.)
- users can also depend on the primary service being brought up rather
  than just being present, this is useful if you need to bring it up
  when it has AT LEAST one member to get link local address or MAC
  addresses (fixing DHCPv6 bring up as well because `ff02::1` is used
  there).

One thing is not addressed yet, if you are running a WLAN service using
RADIUS attached to the bridge, at bring up time, it will try to reach
out the external RADIUS server and *fail*.

To solve this, granular dependency on the DHCPv4 once LAN is joined.
Then the hostapd can wait on defaultroute4 completion so that
connectivity is available to reach RADIUS server.

It can join the bridge later on without any hiccup as well.

This is left as a TODO as hostapd can survive RADIUS authentication
failure and retry later.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 18:15:28 +02:00
Raito Bezarius
1d0fc24111 fix(bridge/members): log attach/detach
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 17:48:54 +02:00
Daniel Barlow
28a5dec7dd implement ifwait trigger service and use in bridge
should we convert all ifwait uses to this trigger too? seems
reasonable
2024-03-28 20:59:39 +00:00
Daniel Barlow
31f0213b6f convert network link/address to module-based-service
... and make bridge use it.

We also had to convert bridge back into a pair of services.
Downstreams want to depend on the bridge it self being configured
even if not necessarily all the members are up. e.g. don't want
to break ssh on lan if there's a misconfigured wlan device
2023-08-28 22:02:28 +01:00
Daniel Barlow
6f92f8fa8b merge bridge services into one 2023-08-16 23:29:53 +01:00
Daniel Barlow
93e04bb834 convert bridge service to serviceDefn 2023-08-05 14:10:14 +01:00
Daniel Barlow
9b70fd62f6 extract bridge to module-based services 2023-07-20 12:02:09 +01:00