Files
buildroot/package/softether/0016-Cedar-Proto_IKE-fix-too-many-arguments-to-function-N.patch
Thomas Perale 5b5aebc085 package/softether: fix various build errors
This patch add several upstream patches that fix build error we are
experiencing on the autobuilder related to host-gcc15 and gcc14.

- 0010-use-bool-from-stdbool.patch

Fix a host-gcc15 error with C23 bool reserved keyword when building
host-softether package. This appeared on the autobuilder.

```
                 from Cfg.c:116:
../../src/Mayaqua/MayaType.h:257:33: error: 'bool' cannot be defined via 'typedef'
  257 | typedef unsigned int            bool;
      |                                 ^~~~
../../src/Mayaqua/MayaType.h:257:33: note: 'bool' is a keyword with '-std=c23' onwards
../../src/Mayaqua/MayaType.h:257:1: warning: useless type name in empty declaration
  257 | typedef unsigned int            bool;
      | ^~~~~~~
```

- 0011-fix-implicit-declaration-of-function-getch.patch

Fix an implicit function declaration.

- 0012-vlanunix-fix-implicit-declaration-of-function-freetap.patch

Fix an implicit function declaration.

- 0013-fix-build-on-freebsd-version-140091.patch

Incompatible pointer type which appeared on the autobuilder as well:

```
Unix.c: In function 'UnixIgnoreSignalForThread':
Unix.c:324:25: error: assignment to 'void (*)(int,  siginfo_t *, void *)' from incompatible pointer type 'void * (*)(int,  siginfo_t *, void *)' [-Wincompatible-pointer-types]
  324 |         sa.sa_sigaction = signal_received_for_ignore;
      |                         ^
```

- 0014-cedar-hub-properly-set-value-for-hub-admin-options.patch

Fix an incompatible pointer type error.

- 0015-adjust-types-of-variables.patch

Fix an incompatible pointer type error which appeared on the autobuilder as
well.

```
Secure.c: In function 'OpenSec':
Secure.c:1829:56: error: passing argument 3 of 'sec->Api->C_GetSlotList' from incompatible pointer type [-Wincompatible-pointer-types]
 1829 |         if ((err = sec->Api->C_GetSlotList(true, NULL, &sec->NumSlot)) != CKR_OK || sec->NumSlot == 0)
      |                                                        ^~~~~~~~~~~~~
      |                                                        |
      |                                                        UINT * {aka unsigned int *}
```

- 0016-Cedar-Proto_IKE-fix-too-many-arguments-to-function-N.patch

Fix a function call.

Fixes: https://autobuild.buildroot.org/results/c43/c43a9a221896d37ee8a9d34c5b8e2725351c6eb5
Fixes: https://autobuild.buildroot.org/results/751/7517bb4d32c38d475d901769b0b2fd2c2f3dd543
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
Acked-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2026-01-01 18:34:41 +01:00

55 lines
2.6 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
From f37845f6ab06d68ea6c669f150eab71ff20f21ff Mon Sep 17 00:00:00 2001
From: Thomas Perale <thomas.perale@mind.be>
Date: Wed, 9 Jul 2025 18:17:21 +0200
Subject: [PATCH] Cedar/Proto_IKE: fix too many arguments to function 'NewBuf'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This commit fixes the following error:
```
Proto_IKE.c: In function ProcIkeQuickModePacketRecv:
Proto_IKE.c:2362:146: error: too many arguments to function NewBuf; expected 0, have 2
2362 | ipsec_sa_sc->SharedKey = NewBuf(shared_key, shared_key_size);
| ^~~~~~ ~~~~~~~~~~
In file included from ../../src/Mayaqua/Mayaqua.h:338,
from CedarPch.h:115,
from IPsec_IKE.c:105:
../../src/Mayaqua/Memory.h:303:6: note: declared here
303 | BUF *NewBuf();
| ^~~~~~
Proto_IKE.c:2363:146: error: too many arguments to function NewBuf; expected 0, have 2
2363 | ipsec_sa_cs->SharedKey = NewBuf(shared_key, shared_key_size);
| ^~~~~~ ~~~~~~~~~~
```
The function `NewBuf` is defined without arguments. Replace it in favour
of `NewBufFromMemory` that copy the content of the pointer into a new
buffer.
Upstream: https://github.com/SoftEtherVPN/SoftEtherVPN/pull/2135
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
---
src/Cedar/IPsec_IKE.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Cedar/IPsec_IKE.c b/src/Cedar/IPsec_IKE.c
index 5d407494..8234f100 100644
--- a/src/Cedar/IPsec_IKE.c
+++ b/src/Cedar/IPsec_IKE.c
@@ -2359,8 +2359,8 @@ void ProcIkeQuickModePacketRecv(IKE_SERVER *ike, UDPPACKET *p, IKE_PACKET *heade
// Update the information of IPsec SA
if (shared_key != NULL)
{
- ipsec_sa_sc->SharedKey = NewBuf(shared_key, shared_key_size);
- ipsec_sa_cs->SharedKey = NewBuf(shared_key, shared_key_size);
+ ipsec_sa_sc->SharedKey = NewBufFromMemory(shared_key, shared_key_size);
+ ipsec_sa_cs->SharedKey = NewBufFromMemory(shared_key, shared_key_size);
}
ipsec_sa_sc->Spi = setting.SpiServerToClient;
--
2.50.0