This is an automated email from the ASF dual-hosted git repository.

bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new 25f35402a [veth] Avoid udev race condtion on systems with systemd 
version > 242.
25f35402a is described below

commit 25f35402a3a45e4499ee24c1938ad7f73290ec7f
Author: Jason Zhou <[email protected]>
AuthorDate: Mon Jul 15 13:06:54 2024 -0400

    [veth] Avoid udev race condtion on systems with systemd version > 242.
    
    In systems with systemd version above 242, there is a potential data
    race where udev will try to update the MAC address of the device at the
    same time as us if the systemd's MacAddressPolicy is set to 'persistent'.
    
    To prevent udev from trying to set the veth device's MAC address by
    itself, we must set the device MAC address on creation so that
    addr_assign_type will be set to NET_ADDR_SET, which prevents udev from
    attempting to change the MAC address of the veth device.
    
    See: 
https://github.com/torvalds/linux/commit/2afb9b533423a9b97f84181e773cf9361d98fed6
    See: 
https://lore.kernel.org/netdev/cahxsexy8lkzocbdbzss_vjopc_tqmyzm87kc192hpmuhmcq...@mail.gmail.com/T/
    See: https://issues.apache.org/jira/browse/MESOS-10243
    
    Review: https://reviews.apache.org/r/75086/
---
 src/linux/routing/link/link.cpp                    | 121 ++++-----------------
 src/linux/routing/link/link.hpp                    |   5 +
 src/linux/routing/link/veth.cpp                    |  40 ++++++-
 src/linux/routing/link/veth.hpp                    |  18 ++-
 .../mesos/isolators/network/port_mapping.cpp       |  18 ++-
 src/tests/containerizer/routing_tests.cpp          | 104 +++++++++++++-----
 6 files changed, 163 insertions(+), 143 deletions(-)

diff --git a/src/linux/routing/link/link.cpp b/src/linux/routing/link/link.cpp
index bb97e3281..f62b37a18 100644
--- a/src/linux/routing/link/link.cpp
+++ b/src/linux/routing/link/link.cpp
@@ -247,124 +247,49 @@ Try<bool> setUp(const string& link)
 
 
 
-// There seems to be a bug that is occassionally preventing ioctl and libnl
-// from setting correct MAC addresses, despite them not returning errors.
-//
-// Observed scenarios with incorrectly assigned MAC addresses:
-//
-// 1. After setting the mac address: ioctl returns the correct MAC address, but
-//    net::mac returns an incorrect MAC address (different from the original!)
-// 2. After setting the mac address: both ioctl and net::mac return the same 
MAC
-//    address, but are both wrong (and different from the original one!)
-// 3. After setting the mac address: there are no cases where ioctl or net::mac
-//    come back with the same MAC address as before we set the address.
-// 4. Before we set the mac address: there is a possibility that ioctl and
-//    net::mac results disagree with each other!
-// 5. There is a possibility that the MAC address we set ends up overwritten by
-//    a garbage value after setMAC has already completed and checked that the
-//    mac address was set correctly. Since this error happens after this
-//    function has finished, we cannot log nor detect it in setMAC because we
-//    have not yet studied at what point this occurs.
-//
-// Notes:
-//
-// 1. We have observed this behavior only on CentOS 9 systems at the moment,
-//    CentOS 7 systems under various kernels do not seem to have the issue
-//    (which is quite strange if this was purely a kernel bug).
-// 2. We have tried kernels 5.15.147, 5.15.160, 5.15.161, all of these have
-//    this issue on CentOS 9.
-//
-// To workaround this bug, we check that the MAC address is set correctly
-// after the ioctl call, and retry the address setting if necessary. In our
-// testing, this workaround appears to workaround scenarios (1), (2), (3),
-// and (4) above, but it does not address scenario (5).
-//
-// See MESOS-10243 for additional details, follow-ups.
 Try<Nothing> setMAC(const string& link, const net::MAC& mac)
 {
-  auto getMacViaIoctl = [](int fd, const string& link) -> Try<ifreq> {
-    ifreq ifr;
-    memset(&ifr, 0, sizeof(ifr));
-    strncpy(ifr.ifr_name, link.c_str(), IFNAMSIZ);
-    if (ioctl(fd, SIOCGIFHWADDR, &ifr) == -1) {
-      return ErrnoError();
-    }
-    return ifr;
-  };
-
   // Since loopback interface has sa_family ARPHRD_LOOPBACK, we need
   // to get the MAC address of the link first to decide what value the
   // sa_family should be.
   //
   // TODO(jieyu): We use ioctl to set the MAC address because the
   // interfaces in libnl have some issues with virtual devices.
+  struct ifreq ifr;
+  memset(&ifr, 0, sizeof(ifr));
+
+  strncpy(ifr.ifr_name, link.c_str(), IFNAMSIZ);
+
   int fd = ::socket(AF_INET, SOCK_STREAM, 0);
   if (fd == -1) {
     return ErrnoError();
   }
 
-  Try<ifreq> if_request = getMacViaIoctl(fd, link);
-  if (if_request.isError()) {
+  // Since loopback interface has sa_family ARPHRD_LOOPBACK, we need
+  // to get the MAC address of the link first to decide what value the
+  // sa_family should be.
+  if (ioctl(fd, SIOCGIFHWADDR, &ifr) == -1) {
+    // Save the error string as os::close may overwrite errno.
+    const string message = os::strerror(errno);
     os::close(fd);
-    return Error(if_request.error());
-  }
-
-  // See comment above this function on why we check this and use a loop below.
-  Result<net::MAC> net_mac = net::mac(link);
-  net::MAC ioctl_mac = net::MAC(if_request->ifr_hwaddr.sa_data);
-
-  if (!(net_mac.isSome() && *net_mac == ioctl_mac)) {
-    LOG(WARNING)
-      << "MAC mismatch between net::mac = " << (net_mac.isSome()
-         ? stringify(*net_mac) : (net_mac.isError() ? net_mac.error() : 
"None"))
-      << " and ioctl = " << stringify(ioctl_mac)
-      << " for link " << stringify(link)
-      << " before setting to target mac address " << stringify(mac);
+    return Error(message);
   }
 
-  for (int i = 0; i < 10; ++i) {
-    if_request->ifr_hwaddr.sa_data[0] = mac[0];
-    if_request->ifr_hwaddr.sa_data[1] = mac[1];
-    if_request->ifr_hwaddr.sa_data[2] = mac[2];
-    if_request->ifr_hwaddr.sa_data[3] = mac[3];
-    if_request->ifr_hwaddr.sa_data[4] = mac[4];
-    if_request->ifr_hwaddr.sa_data[5] = mac[5];
-
-    if (ioctl(fd, SIOCSIFHWADDR, &(*if_request)) == -1) {
-      const string message = os::strerror(errno);
-      os::close(fd);
-      return Error(message);
-    }
-
-    // Prepare another read to check if the MAC address was set correctly.
-    if_request = getMacViaIoctl(fd, link);
-    if (if_request.isError()) {
-      os::close(fd);
-      return Error(if_request.error());
-    }
-
-    net_mac = net::mac(link);
-    ioctl_mac = net::MAC(if_request->ifr_hwaddr.sa_data);
+  ifr.ifr_hwaddr.sa_data[0] = mac[0];
+  ifr.ifr_hwaddr.sa_data[1] = mac[1];
+  ifr.ifr_hwaddr.sa_data[2] = mac[2];
+  ifr.ifr_hwaddr.sa_data[3] = mac[3];
+  ifr.ifr_hwaddr.sa_data[4] = mac[4];
+  ifr.ifr_hwaddr.sa_data[5] = mac[5];
 
-    if (net_mac.isSome() && *net_mac == mac && ioctl_mac == mac) {
-      break;
-    }
-
-    LOG(WARNING)
-      << "MAC mismatch between target mac = " << stringify(mac)
-      << " and net::mac = " << (net_mac.isSome()
-         ? stringify(*net_mac) : (net_mac.isError() ? net_mac.error() : 
"None"))
-      << " and ioctl: " << stringify(ioctl_mac)
-      << " for link " << stringify(link) << "; retrying set operation...";
+  if (ioctl(fd, SIOCSIFHWADDR, &ifr) == -1) {
+    // Save the error string as os::close may overwrite errno.
+    const string message = os::strerror(errno);
+    os::close(fd);
+    return Error(message);
   }
 
   os::close(fd);
-
-  if (!(net_mac.isSome() && *net_mac == mac && ioctl_mac == mac)) {
-    return Error(
-      "net::mac and ioctl did not report the correct address despite multiple"
-      " attempts to set target MAC address");
-  }
   return Nothing();
 }
 
diff --git a/src/linux/routing/link/link.hpp b/src/linux/routing/link/link.hpp
index 09790f317..58d1f60aa 100644
--- a/src/linux/routing/link/link.hpp
+++ b/src/linux/routing/link/link.hpp
@@ -82,6 +82,11 @@ Try<bool> setUp(const std::string& link);
 
 // Sets the MAC address of the link. Returns false if the link is not
 // found.
+// It should be noted that this function should NOT be used to set a veth
+// device's MAC address on creation. That should be done in veth::create to
+// avoid a race condtion with udev in systems with systemd version > 242.
+//
+// see: https://issues.apache.org/jira/browse/MESOS-10243
 Try<Nothing> setMAC(const std::string& link, const net::MAC& mac);
 
 
diff --git a/src/linux/routing/link/veth.cpp b/src/linux/routing/link/veth.cpp
index 6aeb95e71..36aad5fec 100644
--- a/src/linux/routing/link/veth.cpp
+++ b/src/linux/routing/link/veth.cpp
@@ -19,6 +19,8 @@
 #include <netlink/errno.h>
 
 #include <netlink/route/link/veth.h>
+#include <netlink/route/link.h>
+#include <netlink/netlink.h>
 
 #include <stout/error.hpp>
 
@@ -35,18 +37,44 @@ namespace veth {
 Try<bool> create(
     const string& veth,
     const string& peer,
-    const Option<pid_t>& pid)
+    const Option<pid_t>& pid,
+    const Option<net::MAC>& veth_mac)
 {
   Try<Netlink<struct nl_sock>> socket = routing::socket();
   if (socket.isError()) {
     return Error(socket.error());
   }
 
-  int error = rtnl_link_veth_add(
-      socket->get(),
-      veth.c_str(),
-      peer.c_str(),
-      (pid.isNone() ? getpid() : pid.get()));
+  struct nl_sock *sock = socket->get();
+  struct rtnl_link *link, *peer_link;
+  int error = -NLE_NOMEM;
+
+  if (!(link = rtnl_link_veth_alloc())) {
+    return Error(nl_geterror(error));
+  }
+  peer_link = rtnl_link_veth_get_peer(link);
+
+  struct nl_addr *addr;
+
+  if (veth_mac.isSome()) {
+    unsigned char mac_addr_uchar[6];
+    for (int i = 0; i < 6; i++) {
+      mac_addr_uchar[i] = (unsigned char) (*veth_mac)[i];
+    }
+    addr = nl_addr_build(AF_LLC, mac_addr_uchar, 6);
+    rtnl_link_set_addr(link, addr);
+  }
+
+  rtnl_link_set_name(link, veth.c_str());
+  rtnl_link_set_name(peer_link, peer.c_str());
+
+  rtnl_link_set_ns_pid(peer_link, pid.getOrElse(getpid()));
+  error = rtnl_link_add(sock, link, NLM_F_CREATE | NLM_F_EXCL);
+
+  rtnl_link_put(link);
+  if (veth_mac.isSome()) {
+    nl_addr_put(addr);
+  }
 
   if (error != 0) {
     if (error == -NLE_EXIST) {
diff --git a/src/linux/routing/link/veth.hpp b/src/linux/routing/link/veth.hpp
index a4acbe9b5..1e54ce696 100644
--- a/src/linux/routing/link/veth.hpp
+++ b/src/linux/routing/link/veth.hpp
@@ -23,6 +23,7 @@
 
 #include <stout/option.hpp>
 #include <stout/try.hpp>
+#include <stout/mac.hpp>
 
 namespace routing {
 namespace link {
@@ -33,10 +34,25 @@ namespace veth {
 // specified. If 'pid' is None, the peer link will be put into
 // caller's network namespace. Returns false if the virtual network
 // links (with the same name) already exist.
+//
+// We provide the ability to assign a specified MAC to the host network
+// namespace veth device on creation via veth_mac:
+//
+// In systems with systemd version above 242, there is a potential data race
+// where udev will try to update the MAC address of the device at the same
+// time as us if the systemd's MacAddressPolicy is set to 'persistent'.
+// To prevent udev from trying to set the veth device's MAC address by itself,
+// we *must* set the device MAC address on creation so that addr_assign_type
+// will be set to NET_ADDR_SET, which prevents udev from attempting to
+// change the MAC address of the veth device.
+// see: 
https://github.com/torvalds/linux/commit/2afb9b533423a9b97f84181e773cf9361d98fed6
+// see: 
https://lore.kernel.org/netdev/cahxsexy8lkzocbdbzss_vjopc_tqmyzm87kc192hpmuhmcq...@mail.gmail.com/T/
+// see: https://issues.apache.org/jira/browse/MESOS-10243
 Try<bool> create(
     const std::string& veth,
     const std::string& peer,
-    const Option<pid_t>& pid);
+    const Option<pid_t>& pid,
+    const Option<net::MAC>& veth_mac);
 
 } // namespace veth {
 } // namespace link {
diff --git a/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp 
b/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp
index 52b63f524..894d77c56 100644
--- a/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp
+++ b/src/slave/containerizer/mesos/isolators/network/port_mapping.cpp
@@ -3595,8 +3595,13 @@ Future<Nothing> PortMappingIsolatorProcess::isolate(
   LOG(INFO) << "Created network namespace handle symlink '"
             << linker << "' -> '" << target << "'";
 
-  // Create a virtual ethernet pair for this container.
-  Try<bool> createVethPair = link::veth::create(veth(pid), eth0, pid);
+  // Create a virtual ethernet pair for this container, also set the MAC
+  // address of the host network namespace veth<pid> interface to match
+  // that of the host network namespace eth0.
+  //
+  // TODO(jasonzhou): Also set the mac address of the container network
+  // namespace eth0 here on creation, to avoid the race with udev: MESOS-10243.
+  Try<bool> createVethPair = link::veth::create(veth(pid), eth0, pid, hostMAC);
   if (createVethPair.isError()) {
     return Failure(
         "Failed to create virtual ethernet pair: " +
@@ -3623,15 +3628,6 @@ Future<Nothing> PortMappingIsolatorProcess::isolate(
     }
   }
 
-  // Sets the MAC address of veth to match the MAC address of the host
-  // public interface (eth0).
-  Try<Nothing> setVethMAC = link::setMAC(veth(pid), hostMAC);
-  if (setVethMAC.isError()) {
-    return Failure(
-        "Failed to set the MAC address of " + veth(pid) +
-        ": " + setVethMAC.error());
-  }
-
   // Prepare the ingress queueing disciplines on veth.
   Try<bool> createQdisc = ingress::create(veth(pid));
   if (createQdisc.isError()) {
diff --git a/src/tests/containerizer/routing_tests.cpp 
b/src/tests/containerizer/routing_tests.cpp
index c9fa2e86a..b18f741e0 100644
--- a/src/tests/containerizer/routing_tests.cpp
+++ b/src/tests/containerizer/routing_tests.cpp
@@ -260,7 +260,8 @@ protected:
 
 TEST_F(RoutingVethTest, ROOT_LinkCreate)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -269,13 +270,40 @@ TEST_F(RoutingVethTest, ROOT_LinkCreate)
   EXPECT_SOME_NE(0, link::index(TEST_PEER_LINK));
 
   // Test the case where the veth (with the same name) already exists.
-  EXPECT_SOME_FALSE(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, 
None()));
+  EXPECT_SOME_FALSE(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
+}
+
+
+TEST_F(RoutingVethTest, ROOT_LinkCreateWithTargetMAC)
+{
+  uint8_t bytes[6] = {0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc};
+  net::MAC target_mac = net::MAC(bytes);
+
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), target_mac));
+
+  EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
+  EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
+
+  EXPECT_SOME_NE(0, link::index(TEST_VETH_LINK));
+  EXPECT_SOME_NE(0, link::index(TEST_PEER_LINK));
+
+  Result<net::MAC> mac = net::mac(TEST_VETH_LINK);
+
+  ASSERT_SOME(mac);
+  EXPECT_EQ(*mac, target_mac);
+
+  // Test the case where the veth (with the same name) already exists.
+  EXPECT_SOME_FALSE(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 }
 
 
 TEST_F(RoutingVethTest, ROOT_LinkRemove)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::remove(TEST_VETH_LINK));
   EXPECT_SOME_FALSE(link::remove(TEST_VETH_LINK));
@@ -311,7 +339,7 @@ TEST_F(RoutingVethTest, ROOT_LinkCreatePid)
   ASSERT_NE(-1, pid);
 
   // In parent process.
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, pid));
+  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, pid, None()));
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
 
   // The peer should not exist in parent network namespace.
@@ -334,7 +362,8 @@ TEST_F(RoutingVethTest, ROOT_LinkWait)
 {
   AWAIT_READY(link::removed(TEST_VETH_LINK));
 
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -349,7 +378,8 @@ TEST_F(RoutingVethTest, ROOT_LinkWait)
 
 TEST_F(RoutingVethTest, ROOT_LinkSetUp)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -369,7 +399,8 @@ TEST_F(RoutingVethTest, ROOT_LinkSetUp)
 
 TEST_F(RoutingVethTest, ROOT_LinkSetMAC)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -400,7 +431,8 @@ TEST_F(RoutingVethTest, ROOT_LinkSetMAC)
 
 TEST_F(RoutingVethTest, ROOT_LinkMTU)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -421,7 +453,8 @@ TEST_F(RoutingVethTest, ROOT_IngressQdisc)
   // Test for a qdisc on a nonexistent interface should fail.
   EXPECT_SOME_FALSE(ingress::exists("noSuchInterface"));
 
-  EXPECT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  EXPECT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -485,7 +518,8 @@ TEST_F(RoutingVethTest, ROOT_HTBQdisc)
   // Test for a qdisc on a nonexistent interface should fail.
   EXPECT_SOME_FALSE(htb::exists("noSuchInterface", EGRESS_ROOT));
 
-  EXPECT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  EXPECT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -569,7 +603,8 @@ TEST_F(RoutingVethTest, ROOT_FqCodeQdisc)
   // Test for a qdisc on a nonexistent interface should fail.
   EXPECT_SOME_FALSE(fq_codel::exists("noSuchInterface", EGRESS_ROOT));
 
-  EXPECT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  EXPECT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -650,7 +685,8 @@ TEST_F(RoutingVethTest, ROOT_FqCodeQdisc)
 
 TEST_F(RoutingVethTest, ROOT_FqCodelClassifier)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -726,7 +762,8 @@ TEST_F(RoutingVethTest, ROOT_FqCodelClassifier)
 
 TEST_F(RoutingVethTest, ROOT_ARPFilterCreate)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -746,7 +783,8 @@ TEST_F(RoutingVethTest, ROOT_ARPFilterCreate)
 
 TEST_F(RoutingVethTest, ROOT_ARPFilterCreateDuplicated)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -776,7 +814,8 @@ TEST_F(RoutingVethTest, ROOT_ARPFilterCreateDuplicated)
 
 TEST_F(RoutingVethTest, ROOT_ARPFilterRemove)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -801,7 +840,8 @@ TEST_F(RoutingVethTest, ROOT_ARPFilterRemove)
 
 TEST_F(RoutingVethTest, ROOT_ARPFilterUpdate)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -838,7 +878,8 @@ TEST_F(RoutingVethTest, ROOT_ARPFilterUpdate)
 
 TEST_F(RoutingVethTest, ROOT_ICMPFilterCreate)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -870,7 +911,8 @@ TEST_F(RoutingVethTest, ROOT_ICMPFilterCreate)
 
 TEST_F(RoutingVethTest, ROOT_ICMPFilterCreateDuplicated)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -903,7 +945,8 @@ TEST_F(RoutingVethTest, ROOT_ICMPFilterCreateDuplicated)
 
 TEST_F(RoutingVethTest, ROOT_ICMPFilterCreateMultiple)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -940,7 +983,7 @@ TEST_F(RoutingVethTest, ROOT_ICMPFilterCreateMultiple)
 TEST_F(RoutingVethTest, ROOT_ICMPFilterRemove)
 {
   ASSERT_SOME(link::veth::create(
-      TEST_VETH_LINK, TEST_PEER_LINK, None()));
+      TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -973,7 +1016,8 @@ TEST_F(RoutingVethTest, ROOT_ICMPFilterRemove)
 
 TEST_F(RoutingVethTest, ROOT_ICMPFilterUpdate)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -1029,7 +1073,8 @@ TEST_F(RoutingVethTest, ROOT_ICMPFilterUpdate)
 
 TEST_F(RoutingVethTest, ROOT_IPFilterCreate)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -1087,7 +1132,8 @@ TEST_F(RoutingVethTest, ROOT_IPFilterCreate)
 
 TEST_F(RoutingVethTest, ROOT_IPFilterCreate2)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -1122,7 +1168,8 @@ TEST_F(RoutingVethTest, ROOT_IPFilterCreate2)
 
 TEST_F(RoutingVethTest, ROOT_IPFilterCreateDuplicated)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -1171,7 +1218,8 @@ TEST_F(RoutingVethTest, ROOT_IPFilterCreateDuplicated)
 
 TEST_F(RoutingVethTest, ROOT_IPFilterCreateMultiple)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -1263,7 +1311,8 @@ TEST_F(RoutingVethTest, ROOT_IPFilterCreateMultiple)
 
 TEST_F(RoutingVethTest, ROOT_IPFilterRemove)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));
@@ -1340,7 +1389,8 @@ TEST_F(RoutingVethTest, ROOT_IPFilterRemove)
 // Test the workaround introduced for MESOS-1617.
 TEST_F(RoutingVethTest, ROOT_HandleGeneration)
 {
-  ASSERT_SOME(link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None()));
+  ASSERT_SOME(
+      link::veth::create(TEST_VETH_LINK, TEST_PEER_LINK, None(), None()));
 
   EXPECT_SOME_TRUE(link::exists(TEST_VETH_LINK));
   EXPECT_SOME_TRUE(link::exists(TEST_PEER_LINK));

Reply via email to