diff options
| author | Jon Mason <jdmason@kudzu.us> | 2024-09-16 19:53:49 -0400 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-09-17 12:16:01 +0100 |
| commit | d141a3f1ef04bb35dd84c78034f431d9c26830b8 (patch) | |
| tree | 2bff95a1c0a4ba3dca03a843835f0af47cac8e97 | |
| parent | 5f2557e8ed8c02d9a896c293a81e0c1f3c0e406a (diff) | |
| download | poky-d141a3f1ef04bb35dd84c78034f431d9c26830b8.tar.gz | |
wpa-supplicant: add patch to check for kernel header version when compiling macsec
When using Arm binary toolchain, version 2.11 of wpa-supplicant is
failing to compile with the following error:
| ../src/drivers/driver_macsec_linux.c:81:29: error: field ‘offload’ has incomplete type
| 81 | enum macsec_offload offload;
| |
Backport a recent patch that corrects the issue by adding a check for
the version of kernel headers being used in compilation and disabling
that enum if too old a version is being used (or is used by the
binary toolchain).
(From OE-Core rev: 373d8d4f5316416d70eb2c0733d9838e57419ac3)
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-macsec_linux-Hardware-offload-requires-Linux-headers.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-macsec_linux-Hardware-offload-requires-Linux-headers.patch new file mode 100644 index 0000000000..f9634e47c9 --- /dev/null +++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-macsec_linux-Hardware-offload-requires-Linux-headers.patch | |||
| @@ -0,0 +1,53 @@ | |||
| 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 | |||
| 6 | Hardware offload in Linux macsec driver is enabled in compile time if | ||
| 7 | libnl version is >= v3.6. This is not sufficient for successful build | ||
| 8 | since enum 'macsec_offload' has been added to Linux header if_link.h | ||
| 9 | in kernels v5.6 and v5.7, see commits: | ||
| 10 | - https://github.com/torvalds/linux/commit/21114b7feec29e4425a3ac48a037569c016a46c8 | ||
| 11 | - https://github.com/torvalds/linux/commit/76564261a7db80c5f5c624e0122a28787f266bdf | ||
| 12 | |||
| 13 | New libnl with older Linux headers is a valid combination. This is how | ||
| 14 | hostapd build failure has been detected by Buildroot autobuilder, see: | ||
| 15 | - http://autobuild.buildroot.net/results/b59d5bc5bd17683a3a1e3577c40c802e81911f84/ | ||
| 16 | |||
| 17 | Extend compile time condition for the enablement of the macsec hardware | ||
| 18 | offload adding Linux headers version check. | ||
| 19 | |||
| 20 | Fixes: 40c139664439 ("macsec_linux: Add support for MACsec hardware offload") | ||
| 21 | Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com> | ||
| 22 | |||
| 23 | Upstream-Status: Backport [https://w1.fi/cgit/hostap/patch/?id=809d9d8172db8e2a08ff639875f838b5b86d2641] | ||
| 24 | Signed-off-by: Jon Mason <jdmason@kudzu.us> | ||
| 25 | --- | ||
| 26 | src/drivers/driver_macsec_linux.c | 4 +++- | ||
| 27 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
| 28 | |||
| 29 | diff --git a/src/drivers/driver_macsec_linux.c b/src/drivers/driver_macsec_linux.c | ||
| 30 | index c867154981e9..fad47a292f9f 100644 | ||
| 31 | --- a/src/drivers/driver_macsec_linux.c | ||
| 32 | +++ b/src/drivers/driver_macsec_linux.c | ||
| 33 | @@ -19,6 +19,7 @@ | ||
| 34 | #include <netlink/route/link.h> | ||
| 35 | #include <netlink/route/link/macsec.h> | ||
| 36 | #include <linux/if_macsec.h> | ||
| 37 | +#include <linux/version.h> | ||
| 38 | #include <inttypes.h> | ||
| 39 | |||
| 40 | #include "utils/common.h" | ||
| 41 | @@ -32,7 +33,8 @@ | ||
| 42 | |||
| 43 | #define UNUSED_SCI 0xffffffffffffffff | ||
| 44 | |||
| 45 | -#if LIBNL_VER_NUM >= LIBNL_VER(3, 6) | ||
| 46 | +#if (LIBNL_VER_NUM >= LIBNL_VER(3, 6) && \ | ||
| 47 | + LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0)) | ||
| 48 | #define LIBNL_HAS_OFFLOAD | ||
| 49 | #endif | ||
| 50 | |||
| 51 | -- | ||
| 52 | 2.39.2 | ||
| 53 | |||
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.11.bb b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.11.bb index 321dedc58a..257ef43b6e 100644 --- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.11.bb +++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.11.bb | |||
| @@ -15,6 +15,7 @@ SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \ | |||
| 15 | file://wpa_supplicant.conf \ | 15 | file://wpa_supplicant.conf \ |
| 16 | file://wpa_supplicant.conf-sane \ | 16 | file://wpa_supplicant.conf-sane \ |
| 17 | file://99_wpa_supplicant \ | 17 | file://99_wpa_supplicant \ |
| 18 | file://0001-macsec_linux-Hardware-offload-requires-Linux-headers.patch \ | ||
| 18 | " | 19 | " |
| 19 | SRC_URI[sha256sum] = "912ea06f74e30a8e36fbb68064d6cdff218d8d591db0fc5d75dee6c81ac7fc0a" | 20 | SRC_URI[sha256sum] = "912ea06f74e30a8e36fbb68064d6cdff218d8d591db0fc5d75dee6c81ac7fc0a" |
| 20 | 21 | ||
