summaryrefslogtreecommitdiffstats
path: root/src/shared/socket-netlink.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2025-01-07 09:29:27 +0100
committerLennart Poettering <lennart@poettering.net>2025-01-10 14:09:48 +0100
commit8c0da3af283ee60569090187ce186b1f4c932749 (patch)
treeca162d690dd3a8d65186840b5834de9bfc32aaa6 /src/shared/socket-netlink.c
parentterminal-util: pidref'ify two terminal related calls (diff)
downloadsystemd-8c0da3af283ee60569090187ce186b1f4c932749.tar.xz
systemd-8c0da3af283ee60569090187ce186b1f4c932749.zip
tree-wide: port more code to namespace_open_by_type()
Diffstat (limited to '')
-rw-r--r--src/shared/socket-netlink.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/shared/socket-netlink.c b/src/shared/socket-netlink.c
index b0500abd8b..bdb203934b 100644
--- a/src/shared/socket-netlink.c
+++ b/src/shared/socket-netlink.c
@@ -428,15 +428,9 @@ int netns_get_nsid(int netnsfd, uint32_t *ret) {
int r;
if (netnsfd < 0) {
- r = namespace_open(
- 0,
- /* ret_pidns_fd = */ NULL,
- /* ret_mntns_fd = */ NULL,
- &_netns_fd,
- /* ret_userns_fd = */ NULL,
- /* ret_root_fd = */ NULL);
- if (r < 0)
- return r;
+ _netns_fd = namespace_open_by_type(NAMESPACE_NET);
+ if (_netns_fd < 0)
+ return _netns_fd;
netnsfd = _netns_fd;
}