From: Kunhoon Baik Date: Mon, 23 Aug 2021 07:53:47 +0000 (+0900) Subject: Disable Net NS feature for Tizen X-Git-Tag: submit/tizen/20210825.085400~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c54c3c6c38844627d3fa72fd0e97ed8ba7cf91d;p=platform%2Fupstream%2Fnsjail.git 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. --- 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) {