From: Kunhoon Baik Date: Mon, 23 Aug 2021 07:20:38 +0000 (+0900) Subject: Disable MACVLAN feature for Tizen X-Git-Tag: submit/tizen/20210825.085400~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51ae770598e484bb5006fbb6675a7bf6a0294d99;p=platform%2Fupstream%2Fnsjail.git Disable MACVLAN feature for Tizen Tizen does not support libnl3 macvlan officially because libnl3 version is 3.2.22. In addition, MACVLAN feature was not tested in Tizen. At this moment, malort project does not require network virtualization. Thus, at this moment, it is ok to disable Tizen. In the future, when MACVLAN supports in Tizen, MACVLAN feature will be enabled. --- diff --git a/net.cc b/net.cc index 87c3df9..3f93ae4 100644 --- a/net.cc +++ b/net.cc @@ -52,8 +52,9 @@ namespace net { #define IFACE_NAME "vs" #include -#include +#ifndef TIZEN +#include static bool cloneIface( nsjconf_t* nsjconf, struct nl_sock* sk, struct nl_cache* link_cache, int pid) { struct rtnl_link* rmv = rtnl_link_macvlan_alloc(); @@ -101,6 +102,13 @@ static bool cloneIface( rtnl_link_put(rmv); return true; } +#else +static bool cloneIface( + nsjconf_t* nsjconf, struct nl_sock* sk, struct nl_cache* link_cache, int pid) { + LOG_E("Tizen does not support macvlan officially"); + return false; +} +#endif static bool moveToNs( const std::string& iface, struct nl_sock* sk, struct nl_cache* link_cache, pid_t pid) { @@ -118,7 +126,9 @@ 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) {