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

commit 7136442fa938ded0fab2dd05682d8c8fa0186b08
Author: Devin Leamy <[email protected]>
AuthorDate: Wed Jan 24 17:06:12 2024 +0000

    Enforce libnl3 >= 3.5 to prevent overflow errors in the port mapping 
isolator.
    
    libnl 3.5 changes the interface for link rates (bytes/s) from using a 32 
bit integer to
    a 64 bit integer. Given that modern links can be on the order of 100 GB/s, 
using
    a 32 bit integer introduces a potential for overflow. This change prevents 
this kind
    of overflow from happening.
    
    Link rates are queried through libnl in the port mapping isolator.
    
    Relevant libnl commit:
    - 
https://github.com/thom311/libnl/commit/4cf69a1b7b2518d18e1a62c79a461bca109132fc
---
 m4/libnl3.m4 | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/m4/libnl3.m4 b/m4/libnl3.m4
index e64ba4925..21d386c58 100644
--- a/m4/libnl3.m4
+++ b/m4/libnl3.m4
@@ -23,7 +23,7 @@ AC_DEFUN([MESOS_MSG_LIBNL3_ERROR], [
 
 AC_MSG_ERROR([$1
 -------------------------------------------------------------------
-Please install libnl3 (version 3.2.26 or higher):
+Please install libnl3 (version 3.5.0 or higher):
 https://github.com/thom311/libnl/releases
 -------------------------------------------------------------------
 ])
@@ -53,6 +53,25 @@ AS_IF([test x$ac_mesos_have_libnl3 = x], [
   ])
 ])
 
+# Check for version 3.5.0 or higher.
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <netlink/version.h>
+
+int main() {
+  if (LIBNL_VER_MAJ < 3) {
+    return 1;
+  } else if (LIBNL_VER_MAJ > 3) {
+    return 0;
+  }
+
+  if (LIBNL_VER_MIN < 5) {
+    return 1;
+  } 
+
+  return 0;
+}
+]])], [], [ac_mesos_have_libnl3=no], [])
+
 AC_CHECK_HEADERS(
   [netlink/netlink.h netlink/route/link/veth.h],
   [], [ac_mesos_have_libnl3=no]

Reply via email to