Disable MACVLAN feature for Tizen
authorKunhoon Baik <knhoon.baik@samsung.com>
Mon, 23 Aug 2021 07:20:38 +0000 (16:20 +0900)
committerKunhoon Baik <knhoon.baik@samsung.com>
Mon, 23 Aug 2021 07:20:38 +0000 (16:20 +0900)
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

diff --git a/net.cc b/net.cc
index 87c3df9811848d15f6600dc9a744c31de457980f..3f93ae40d17859c700ef277499860891cf5fc258 100644 (file)
--- a/net.cc
+++ b/net.cc
@@ -52,8 +52,9 @@ namespace net {
 #define IFACE_NAME "vs"
 
 #include <netlink/route/link.h>
-#include <netlink/route/link/macvlan.h>
 
+#ifndef TIZEN
+#include <netlink/route/link/macvlan.h>
 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) {