Commit Graph

1 Commits

Author SHA1 Message Date
Paul Holzinger d8e8a9947b libnetwork: add rootlessnetns package
Add a new rootlessnetns package based on the rootless netns code from
podman. It however makes some significant changes:
 - First it uses a directory in the runroot and not tmpdir.
 - The netns mount is stored in the directoy and not the global netns
   runtime dir to prevent name collisions. The old code used the sha256
   to do that.
 - The teardown and setup logic has been made more robust and now used a
   reference counter to keep track on when to cleanup. The podman
   cleanup logic was racy and tied to running podman containers. Given
   the plan to allow buildah to use this as well we need this.
 - There is no lock for this code, the goal is to have this called
   through the network interface which is already locked so there is no
   need for another lock here.

Future work:
 - add pasta support
 - add port forwarding logic here

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-12-05 14:06:20 +01:00