From 649485facedf586aa0d85700caa0811b0f0038e1 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 6 May 2024 09:53:22 -0400 Subject: [PATCH] MT#55283 compile fix for kernels < 5.14 Change-Id: I7c996a7089089e429185462807d565fc673e0f55 --- kernel-module/xt_RTPENGINE.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel-module/xt_RTPENGINE.c b/kernel-module/xt_RTPENGINE.c index 9af7f99ac..cb75a9162 100644 --- a/kernel-module/xt_RTPENGINE.c +++ b/kernel-module/xt_RTPENGINE.c @@ -1822,7 +1822,13 @@ static const struct vm_operations_struct vm_mmap_ops = { static void *shm_map_resolve(void *p, size_t size) { struct vm_area_struct *vma; // XXX is there a better way to map this to the kernel address? +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) vma = vma_lookup(current->mm, (unsigned long) p); +#else + vma = find_vma(current->mm, (unsigned long) p); + if (vma && (unsigned long) p < vma->vm_start) + vma = NULL; +#endif if (!vma) return NULL; if (!vma->vm_private_data)