diff options
4 files changed, 239 insertions, 2 deletions
diff --git a/meta-networking/recipes-support/strongswan/strongswan/0001-pki-Fix-signature-of-help-to-match-that-of-a-callbac.patch b/meta-networking/recipes-support/strongswan/strongswan/0001-pki-Fix-signature-of-help-to-match-that-of-a-callbac.patch new file mode 100644 index 0000000000..92c848f095 --- /dev/null +++ b/meta-networking/recipes-support/strongswan/strongswan/0001-pki-Fix-signature-of-help-to-match-that-of-a-callbac.patch | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | From a7b5de569082398a14b7e571498e55d005903aaf Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Tobias Brunner <tobias@strongswan.org> | ||
| 3 | Date: Fri, 21 Feb 2025 17:18:35 +0100 | ||
| 4 | Subject: [PATCH] pki: Fix signature of help() to match that of a callback in | ||
| 5 | command_t | ||
| 6 | |||
| 7 | Upstream-Status: Backport [a7b5de5 pki: Fix signature of help() to match that of a callback in command_t] | ||
| 8 | Signed-off-by: mark.yang <mark.yang@lge.com> | ||
| 9 | --- | ||
| 10 | src/pki/command.c | 2 +- | ||
| 11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 12 | |||
| 13 | diff --git a/src/pki/command.c b/src/pki/command.c | ||
| 14 | index accec5fe5..6e6bf041e 100644 | ||
| 15 | --- a/src/pki/command.c | ||
| 16 | +++ b/src/pki/command.c | ||
| 17 | @@ -265,7 +265,7 @@ int command_usage(char *error) | ||
| 18 | /** | ||
| 19 | * Show usage information | ||
| 20 | */ | ||
| 21 | -static int help(int c, char *v[]) | ||
| 22 | +static int help() | ||
| 23 | { | ||
| 24 | return command_usage(NULL); | ||
| 25 | } | ||
diff --git a/meta-networking/recipes-support/strongswan/strongswan/0002-callback-job-Replace-return_false-in-constructors-wi.patch b/meta-networking/recipes-support/strongswan/strongswan/0002-callback-job-Replace-return_false-in-constructors-wi.patch new file mode 100644 index 0000000000..09451206ca --- /dev/null +++ b/meta-networking/recipes-support/strongswan/strongswan/0002-callback-job-Replace-return_false-in-constructors-wi.patch | |||
| @@ -0,0 +1,90 @@ | |||
| 1 | From d5d2568ff0e88d364dadf50b67bf17050763cf98 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Tobias Brunner <tobias@strongswan.org> | ||
| 3 | Date: Fri, 21 Feb 2025 16:45:57 +0100 | ||
| 4 | Subject: [PATCH] callback-job: Replace return_false() in constructors with | ||
| 5 | dedicated function | ||
| 6 | |||
| 7 | Besides being clearer, this fixes issues with GCC 15. The latter uses | ||
| 8 | C23 by default, which changes the meaning of function declarations | ||
| 9 | without parameters such as | ||
| 10 | |||
| 11 | bool return false(); | ||
| 12 | |||
| 13 | Instead of "this function takes an unknown number of arguments", this | ||
| 14 | now equals (void), that is, "this function takes no arguments". So we | ||
| 15 | run into incompatible pointer type warnings all over when using such | ||
| 16 | functions. They could be cast to (void*) but this seems the cleaner | ||
| 17 | solution for this use case. | ||
| 18 | |||
| 19 | Upstream-Status: Backport [d5d2568 callback-job: Replace return_false() in constructors with dedicated function] | ||
| 20 | Signed-off-by: mark.yang <mark.yang@lge.com> | ||
| 21 | --- | ||
| 22 | src/libstrongswan/processing/jobs/callback_job.c | 10 +++++++++- | ||
| 23 | src/libstrongswan/processing/jobs/callback_job.h | 11 ++++++++++- | ||
| 24 | src/libstrongswan/processing/scheduler.c | 3 ++- | ||
| 25 | 3 files changed, 21 insertions(+), 3 deletions(-) | ||
| 26 | |||
| 27 | diff --git a/src/libstrongswan/processing/jobs/callback_job.c b/src/libstrongswan/processing/jobs/callback_job.c | ||
| 28 | index cb2a0aba5..3ab40b947 100644 | ||
| 29 | --- a/src/libstrongswan/processing/jobs/callback_job.c | ||
| 30 | +++ b/src/libstrongswan/processing/jobs/callback_job.c | ||
| 31 | @@ -1,5 +1,5 @@ | ||
| 32 | /* | ||
| 33 | - * Copyright (C) 2009-2012 Tobias Brunner | ||
| 34 | + * Copyright (C) 2009-2025 Tobias Brunner | ||
| 35 | * Copyright (C) 2007-2011 Martin Willi | ||
| 36 | * | ||
| 37 | * Copyright (C) secunet Security Networks AG | ||
| 38 | @@ -131,3 +131,11 @@ callback_job_t *callback_job_create(callback_job_cb_t cb, void *data, | ||
| 39 | return callback_job_create_with_prio(cb, data, cleanup, cancel, | ||
| 40 | JOB_PRIO_MEDIUM); | ||
| 41 | } | ||
| 42 | + | ||
| 43 | +/* | ||
| 44 | + * Described in header | ||
| 45 | + */ | ||
| 46 | +bool callback_job_cancel_thread(void *data) | ||
| 47 | +{ | ||
| 48 | + return FALSE; | ||
| 49 | +} | ||
| 50 | diff --git a/src/libstrongswan/processing/jobs/callback_job.h b/src/libstrongswan/processing/jobs/callback_job.h | ||
| 51 | index 0f1ae212d..fda868879 100644 | ||
| 52 | --- a/src/libstrongswan/processing/jobs/callback_job.h | ||
| 53 | +++ b/src/libstrongswan/processing/jobs/callback_job.h | ||
| 54 | @@ -1,5 +1,5 @@ | ||
| 55 | /* | ||
| 56 | - * Copyright (C) 2012 Tobias Brunner | ||
| 57 | + * Copyright (C) 2012-2025 Tobias Brunner | ||
| 58 | * Copyright (C) 2007-2011 Martin Willi | ||
| 59 | * | ||
| 60 | * Copyright (C) secunet Security Networks AG | ||
| 61 | @@ -62,6 +62,15 @@ typedef void (*callback_job_cleanup_t)(void *data); | ||
| 62 | */ | ||
| 63 | typedef bool (*callback_job_cancel_t)(void *data); | ||
| 64 | |||
| 65 | +/** | ||
| 66 | + * Default implementation of callback_job_cancel_t that simply returns FALSE | ||
| 67 | + * to force cancellation of the thread by the processor. | ||
| 68 | + * | ||
| 69 | + * @param data ignored argument | ||
| 70 | + * @return always returns FALSE | ||
| 71 | + */ | ||
| 72 | +bool callback_job_cancel_thread(void *data); | ||
| 73 | + | ||
| 74 | /** | ||
| 75 | * Class representing an callback Job. | ||
| 76 | * | ||
| 77 | diff --git a/src/libstrongswan/processing/scheduler.c b/src/libstrongswan/processing/scheduler.c | ||
| 78 | index c5e5dd83e..76d98ddff 100644 | ||
| 79 | --- a/src/libstrongswan/processing/scheduler.c | ||
| 80 | +++ b/src/libstrongswan/processing/scheduler.c | ||
| 81 | @@ -329,7 +329,8 @@ scheduler_t * scheduler_create() | ||
| 82 | this->heap = (event_t**)calloc(this->heap_size + 1, sizeof(event_t*)); | ||
| 83 | |||
| 84 | job = callback_job_create_with_prio((callback_job_cb_t)schedule, this, | ||
| 85 | - NULL, return_false, JOB_PRIO_CRITICAL); | ||
| 86 | + NULL, callback_job_cancel_thread, | ||
| 87 | + JOB_PRIO_CRITICAL); | ||
| 88 | lib->processor->queue_job(lib->processor, (job_t*)job); | ||
| 89 | |||
| 90 | return &this->public; | ||
diff --git a/meta-networking/recipes-support/strongswan/strongswan/0003-Cast-uses-of-return_-nop-and-enumerator_create_empty.patch b/meta-networking/recipes-support/strongswan/strongswan/0003-Cast-uses-of-return_-nop-and-enumerator_create_empty.patch new file mode 100644 index 0000000000..6c2a77105a --- /dev/null +++ b/meta-networking/recipes-support/strongswan/strongswan/0003-Cast-uses-of-return_-nop-and-enumerator_create_empty.patch | |||
| @@ -0,0 +1,118 @@ | |||
| 1 | From 11978ddd39e800b5f35f721d726e8a4cb7e4ec0f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Tobias Brunner <tobias@strongswan.org> | ||
| 3 | Date: Fri, 21 Feb 2025 17:00:44 +0100 | ||
| 4 | Subject: [PATCH] Cast uses of return_*(), nop() and enumerator_create_empty() | ||
| 5 | |||
| 6 | As described in the previous commit, GCC 15 uses C23 by default and that | ||
| 7 | changes the meaning of such argument-less function declarations. So | ||
| 8 | whenever we assign such a function to a pointer that expects a function | ||
| 9 | with arguments it causes an incompatible pointer type warning. We | ||
| 10 | could define dedicated functions/callbacks whenever necessary, but this | ||
| 11 | seems like the simpler approach for now (especially since most uses of | ||
| 12 | these functions have already been cast). | ||
| 13 | |||
| 14 | Upstream-Status: Backport [11978dd Cast uses of return_*(), nop() and enumerator_create_empty()] | ||
| 15 | Signed-off-by: mark.yang <mark.yang@lge.com> | ||
| 16 | --- | ||
| 17 | src/charon-nm/nm/nm_handler.c | 2 +- | ||
| 18 | src/libcharon/encoding/payloads/encrypted_payload.c | 2 +- | ||
| 19 | src/libcharon/plugins/android_dns/android_dns_handler.c | 2 +- | ||
| 20 | src/libcharon/plugins/ha/ha_attribute.c | 2 +- | ||
| 21 | src/libcharon/plugins/updown/updown_handler.c | 2 +- | ||
| 22 | src/libstrongswan/utils/identification.c | 6 +++--- | ||
| 23 | 6 files changed, 8 insertions(+), 8 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/src/charon-nm/nm/nm_handler.c b/src/charon-nm/nm/nm_handler.c | ||
| 26 | index d7331ad72..39d0190ac 100644 | ||
| 27 | --- a/src/charon-nm/nm/nm_handler.c | ||
| 28 | +++ b/src/charon-nm/nm/nm_handler.c | ||
| 29 | @@ -195,7 +195,7 @@ nm_handler_t *nm_handler_create() | ||
| 30 | .public = { | ||
| 31 | .handler = { | ||
| 32 | .handle = _handle, | ||
| 33 | - .release = nop, | ||
| 34 | + .release = (void*)nop, | ||
| 35 | .create_attribute_enumerator = _create_attribute_enumerator, | ||
| 36 | }, | ||
| 37 | .create_enumerator = _create_enumerator, | ||
| 38 | diff --git a/src/libcharon/encoding/payloads/encrypted_payload.c b/src/libcharon/encoding/payloads/encrypted_payload.c | ||
| 39 | index 676d00b7a..4821c6108 100644 | ||
| 40 | --- a/src/libcharon/encoding/payloads/encrypted_payload.c | ||
| 41 | +++ b/src/libcharon/encoding/payloads/encrypted_payload.c | ||
| 42 | @@ -1023,7 +1023,7 @@ encrypted_fragment_payload_t *encrypted_fragment_payload_create() | ||
| 43 | .get_length = _frag_get_length, | ||
| 44 | .add_payload = _frag_add_payload, | ||
| 45 | .remove_payload = (void*)return_null, | ||
| 46 | - .generate_payloads = nop, | ||
| 47 | + .generate_payloads = (void*)nop, | ||
| 48 | .set_transform = _frag_set_transform, | ||
| 49 | .get_transform = _frag_get_transform, | ||
| 50 | .encrypt = _frag_encrypt, | ||
| 51 | diff --git a/src/libcharon/plugins/android_dns/android_dns_handler.c b/src/libcharon/plugins/android_dns/android_dns_handler.c | ||
| 52 | index 78f4f702a..14d2ff99a 100644 | ||
| 53 | --- a/src/libcharon/plugins/android_dns/android_dns_handler.c | ||
| 54 | +++ b/src/libcharon/plugins/android_dns/android_dns_handler.c | ||
| 55 | @@ -191,7 +191,7 @@ METHOD(enumerator_t, enumerate_dns, bool, | ||
| 56 | VA_ARGS_VGET(args, type, data); | ||
| 57 | *type = INTERNAL_IP4_DNS; | ||
| 58 | *data = chunk_empty; | ||
| 59 | - this->venumerate = return_false; | ||
| 60 | + this->venumerate = (void*)return_false; | ||
| 61 | return TRUE; | ||
| 62 | } | ||
| 63 | |||
| 64 | diff --git a/src/libcharon/plugins/ha/ha_attribute.c b/src/libcharon/plugins/ha/ha_attribute.c | ||
| 65 | index b865a4b82..103d1a937 100644 | ||
| 66 | --- a/src/libcharon/plugins/ha/ha_attribute.c | ||
| 67 | +++ b/src/libcharon/plugins/ha/ha_attribute.c | ||
| 68 | @@ -381,7 +381,7 @@ ha_attribute_t *ha_attribute_create(ha_kernel_t *kernel, ha_segments_t *segments | ||
| 69 | .provider = { | ||
| 70 | .acquire_address = _acquire_address, | ||
| 71 | .release_address = _release_address, | ||
| 72 | - .create_attribute_enumerator = enumerator_create_empty, | ||
| 73 | + .create_attribute_enumerator = (void*)enumerator_create_empty, | ||
| 74 | }, | ||
| 75 | .reserve = _reserve, | ||
| 76 | .destroy = _destroy, | ||
| 77 | diff --git a/src/libcharon/plugins/updown/updown_handler.c b/src/libcharon/plugins/updown/updown_handler.c | ||
| 78 | index 36eb15615..3707e1e65 100644 | ||
| 79 | --- a/src/libcharon/plugins/updown/updown_handler.c | ||
| 80 | +++ b/src/libcharon/plugins/updown/updown_handler.c | ||
| 81 | @@ -220,7 +220,7 @@ updown_handler_t *updown_handler_create() | ||
| 82 | .handler = { | ||
| 83 | .handle = _handle, | ||
| 84 | .release = _release, | ||
| 85 | - .create_attribute_enumerator = enumerator_create_empty, | ||
| 86 | + .create_attribute_enumerator = (void*)enumerator_create_empty, | ||
| 87 | }, | ||
| 88 | .create_dns_enumerator = _create_dns_enumerator, | ||
| 89 | .destroy = _destroy, | ||
| 90 | diff --git a/src/libstrongswan/utils/identification.c b/src/libstrongswan/utils/identification.c | ||
| 91 | index d31955b38..58a05052d 100644 | ||
| 92 | --- a/src/libstrongswan/utils/identification.c | ||
| 93 | +++ b/src/libstrongswan/utils/identification.c | ||
| 94 | @@ -1625,7 +1625,7 @@ static private_identification_t *identification_create(id_type_t type) | ||
| 95 | this->public.hash = _hash_binary; | ||
| 96 | this->public.equals = _equals_binary; | ||
| 97 | this->public.matches = _matches_any; | ||
| 98 | - this->public.contains_wildcards = return_true; | ||
| 99 | + this->public.contains_wildcards = (void*)return_true; | ||
| 100 | break; | ||
| 101 | case ID_FQDN: | ||
| 102 | case ID_RFC822_ADDR: | ||
| 103 | @@ -1660,13 +1660,13 @@ static private_identification_t *identification_create(id_type_t type) | ||
| 104 | this->public.hash = _hash_binary; | ||
| 105 | this->public.equals = _equals_binary; | ||
| 106 | this->public.matches = _matches_range; | ||
| 107 | - this->public.contains_wildcards = return_false; | ||
| 108 | + this->public.contains_wildcards = (void*)return_false; | ||
| 109 | break; | ||
| 110 | default: | ||
| 111 | this->public.hash = _hash_binary; | ||
| 112 | this->public.equals = _equals_binary; | ||
| 113 | this->public.matches = _matches_binary; | ||
| 114 | - this->public.contains_wildcards = return_false; | ||
| 115 | + this->public.contains_wildcards = (void*)return_false; | ||
| 116 | break; | ||
| 117 | } | ||
| 118 | return this; | ||
diff --git a/meta-networking/recipes-support/strongswan/strongswan_6.0.1.bb b/meta-networking/recipes-support/strongswan/strongswan_6.0.1.bb index 9baf219cea..771470f695 100644 --- a/meta-networking/recipes-support/strongswan/strongswan_6.0.1.bb +++ b/meta-networking/recipes-support/strongswan/strongswan_6.0.1.bb | |||
| @@ -8,8 +8,12 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | |||
| 8 | DEPENDS = "flex-native flex bison-native" | 8 | DEPENDS = "flex-native flex bison-native" |
| 9 | DEPENDS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'tpm2', ' tpm2-tss', '', d)}" | 9 | DEPENDS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'tpm2', ' tpm2-tss', '', d)}" |
| 10 | 10 | ||
| 11 | SRC_URI = "https://download.strongswan.org/strongswan-${PV}.tar.bz2 \ | 11 | SRC_URI = " \ |
| 12 | " | 12 | https://download.strongswan.org/strongswan-${PV}.tar.bz2 \ |
| 13 | file://0001-pki-Fix-signature-of-help-to-match-that-of-a-callbac.patch \ | ||
| 14 | file://0002-callback-job-Replace-return_false-in-constructors-wi.patch \ | ||
| 15 | file://0003-Cast-uses-of-return_-nop-and-enumerator_create_empty.patch \ | ||
| 16 | " | ||
| 13 | 17 | ||
| 14 | SRC_URI[sha256sum] = "212368cbc674fed31f3292210303fff06da8b90acad2d1387375ed855e6879c4" | 18 | SRC_URI[sha256sum] = "212368cbc674fed31f3292210303fff06da8b90acad2d1387375ed855e6879c4" |
| 15 | 19 | ||
