Skip to content
Success

Changes

Summary

  1. build: keep netns API public and gate features with HAVE_* (details)
Commit a6979ce1905d60f5e92f70988e265ea45c504e08 by dtv.comp
build: keep netns API public and gate features with HAVE_*

The netns API was previously guarded by platform-specific preprocessor
conditions (e.g. !EMBEDDED and defined(__linux__)), which caused the
netns headers and implementation to be entirely excluded from non-Linux
builds such as Emscripten. This in turn led to build failures in code
depending on the netns API, as the symbols and declarations were not
available at all.

Always build netns.c and keep the public declarations available
for non-embedded builds. Move platform/feature conditionals into the
implementation: guard the netns code paths with HAVE_SETNS/HAVE_UNSHARE/
HAVE_MOUNT and HAVE_CLONE_NEWNET, and return -ENOSYS when the required
functionality is not available.

Add configure-time checks for the required headers/functions and for the
CLONE_NEWNET declaration, defining the
corresponding HAVE_* macros.

No functional changes intended for platforms where netns is available.

Change-Id: I2322eb2936bea35596f1fd6b6a713ea5f997b1ea
The file was modifiedconfigure.ac
The file was modifiedinclude/osmocom/core/netns.h
The file was modifiedsrc/core/netns.c