0002-macsec_linux-Hardware-offload-requires-Linux-headers.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From 809d9d8172db8e2a08ff639875f838b5b86d2641 Mon Sep 17 00:00:00 2001
  2. From: Sergey Matyukevich <geomatsi@gmail.com>
  3. Date: Thu, 22 Aug 2024 00:03:41 +0300
  4. Subject: [PATCH] macsec_linux: Hardware offload requires Linux headers >= v5.7
  5. Hardware offload in Linux macsec driver is enabled in compile time if
  6. libnl version is >= v3.6. This is not sufficient for successful build
  7. since enum 'macsec_offload' has been added to Linux header if_link.h
  8. in kernels v5.6 and v5.7, see commits:
  9. - https://github.com/torvalds/linux/commit/21114b7feec29e4425a3ac48a037569c016a46c8
  10. - https://github.com/torvalds/linux/commit/76564261a7db80c5f5c624e0122a28787f266bdf
  11. New libnl with older Linux headers is a valid combination. This is how
  12. hostapd build failure has been detected by Buildroot autobuilder, see:
  13. - http://autobuild.buildroot.net/results/b59d5bc5bd17683a3a1e3577c40c802e81911f84/
  14. Extend compile time condition for the enablement of the macsec hardware
  15. offload adding Linux headers version check.
  16. Fixes: 40c139664439 ("macsec_linux: Add support for MACsec hardware offload")
  17. Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
  18. Upstream: https://w1.fi/cgit/hostap/commit/?id=809d9d8172db8e2a08ff639875f838b5b86d2641
  19. ---
  20. src/drivers/driver_macsec_linux.c | 4 +++-
  21. 1 file changed, 3 insertions(+), 1 deletion(-)
  22. diff --git a/src/drivers/driver_macsec_linux.c b/src/drivers/driver_macsec_linux.c
  23. index c86715498..fad47a292 100644
  24. --- a/src/drivers/driver_macsec_linux.c
  25. +++ b/src/drivers/driver_macsec_linux.c
  26. @@ -19,6 +19,7 @@
  27. #include <netlink/route/link.h>
  28. #include <netlink/route/link/macsec.h>
  29. #include <linux/if_macsec.h>
  30. +#include <linux/version.h>
  31. #include <inttypes.h>
  32. #include "utils/common.h"
  33. @@ -32,7 +33,8 @@
  34. #define UNUSED_SCI 0xffffffffffffffff
  35. -#if LIBNL_VER_NUM >= LIBNL_VER(3, 6)
  36. +#if (LIBNL_VER_NUM >= LIBNL_VER(3, 6) && \
  37. + LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0))
  38. #define LIBNL_HAS_OFFLOAD
  39. #endif
  40. --
  41. 2.46.0