From 51ae770598e484bb5006fbb6675a7bf6a0294d99 Mon Sep 17 00:00:00 2001 From: Kunhoon Baik Date: Mon, 23 Aug 2021 16:20:38 +0900 Subject: [PATCH] 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. --- net.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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) { -- 2.34.1