From b7baa89fbaa04ceb3227d4d43089d8e6a5326b65 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Fri, 23 Feb 2024 10:40:30 +0100 Subject: ipcpd: Add build option to use pid as address This adds a build option IPCP_DEBUG_LOCAL that will use the pid as the DT name (address) in the unicast IPCP, which is handy for integration testing and debugging. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/unicast/addr-auth/flat.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ipcpd/unicast/addr-auth/flat.c') diff --git a/src/ipcpd/unicast/addr-auth/flat.c b/src/ipcpd/unicast/addr-auth/flat.c index b834e86e..c4562935 100644 --- a/src/ipcpd/unicast/addr-auth/flat.c +++ b/src/ipcpd/unicast/addr-auth/flat.c @@ -69,8 +69,11 @@ uint64_t flat_address(void) { uint32_t addr = INVALID_ADDRESS; +#if defined (CONFIG_OUROBOROS_DEBUG) && defined (IPCP_DEBUG_LOCAL) + addr = getpid(); +#else while (addr == INVALID_ADDRESS) random_buffer(&addr,sizeof(addr)); - +#endif return addr; } -- cgit v1.2.3