[ovs-dev] [PATCH v2] acinclude: Fix build with kernels with prandom* moved to prandom.h.

Ilya Maximets i.maximets at ovn.org
Wed Aug 12 15:51:16 UTC 2020


Recent commit c0842fbc1b18 ("random32: move the pseudo-random 32-bit
definitions to prandom.h") in upstream kernel moved the definition
of prandom_* functions from random.h to prandom.h.  This change was
also backported to stable kernels.

Fixing our configure script to look for these functions in a new
location and avoid build failures:

  datapath/linux/compat/include/linux/random.h:11:19:
    error: redefinition of 'prandom_u32_max'

Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
---

Version 2:
  - Just checking in both files without caring if the first check
    failed or not.

 acinclude.m4 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/acinclude.m4 b/acinclude.m4
index 4bac9dbdd..84f344da0 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -817,6 +817,10 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
                   [prandom_u32[[\(]]],
                   [OVS_DEFINE([HAVE_PRANDOM_U32])])
   OVS_GREP_IFELSE([$KSRC/include/linux/random.h], [prandom_u32_max])
+  OVS_GREP_IFELSE([$KSRC/include/linux/prandom.h],
+                  [prandom_u32[[\(]]],
+                  [OVS_DEFINE([HAVE_PRANDOM_U32])])
+  OVS_GREP_IFELSE([$KSRC/include/linux/prandom.h], [prandom_u32_max])
 
   OVS_GREP_IFELSE([$KSRC/include/net/rtnetlink.h], [get_link_net])
   OVS_GREP_IFELSE([$KSRC/include/net/rtnetlink.h], [name_assign_type])
-- 
2.25.4



More information about the dev mailing list