mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-06 07:33:01 +02:00
Because sysrepo callbacks are threaded and factory-default RPC is called from a separate subscription (to prevent blocking), we cannot prevent ietf-intefaces.c from being called before infix-containers.c, regardless of the priority we set for our subscriptions. When assigning a physical network interface this becomes a bit of a pain during factory-default RPC since the physical interface is hidden from the host network namespace. So, when applying factory to running, we check each interface if it was a container-network previously, if so we call on the container script in the exit of the current dagger generation to move the interface back to the host netns. This affects all other functions that assume interfaces only live in the host netns. To that end a set of new helper functions have been added to wrap iproute2 commands in nsenter when the interface lives elsewhere. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>