From 6c54c3c6c38844627d3fa72fd0e97ed8ba7cf91d Mon Sep 17 00:00:00 2001 From: Kunhoon Baik Date: Mon, 23 Aug 2021 16:53:47 +0900 Subject: [PATCH] Disable Net NS feature for Tizen Tizen does not support libnl3 net namespace officially because libnl3 version is 3.2.22. At this moment, malort project does not require network virtualization. Thus, at this moment, it is ok to disable Tizen. In the future, when libnl3 is upgraded to over 3.2.24, net namespace feature will be enabled. --- net.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/net.cc b/net.cc index 3f93ae4..eeb8b51 100644 --- a/net.cc +++ b/net.cc @@ -110,6 +110,7 @@ static bool cloneIface( } #endif +#ifndef TIZEN static bool moveToNs( const std::string& iface, struct nl_sock* sk, struct nl_cache* link_cache, pid_t pid) { LOG_D("Moving interface '%s' into netns=%d", iface.c_str(), (int)pid); @@ -126,9 +127,7 @@ static bool moveToNs( return false; } -#ifndef TIZEN rtnl_link_set_ns_pid(new_link, pid); -#endif int err = rtnl_link_change(sk, orig_link, new_link, RTM_SETLINK); if (err < 0) { @@ -143,6 +142,13 @@ static bool moveToNs( rtnl_link_put(orig_link); return true; } +#else +static bool moveToNs( + const std::string& iface, struct nl_sock* sk, struct nl_cache* link_cache, pid_t pid) { + return true; +} +#endif + bool initNsFromParent(nsjconf_t* nsjconf, int pid) { if (!nsjconf->clone_newnet) { -- 2.34.1