mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
8e8661e124
In case many net.* sysctls are provided, and we're not running in the host netns, the function keep repeating isNetNS check for every such sysctl. This is a waste of resources. Do the isNetNS check only once, and only if needed. Note that using sync.Once() is not really needed here; we could have used a boolean variable to skip the repeated check, but it looks more idiomatic that way. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>