summaryrefslogtreecommitdiff
path: root/src/ipcpd/unicast
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2024-02-23 10:40:30 +0100
committerSander Vrijders <sander@ouroboros.rocks>2024-02-23 16:41:38 +0100
commitb7baa89fbaa04ceb3227d4d43089d8e6a5326b65 (patch)
tree3f03b349c4645a2a7bc21c0bc5a9d9c57604122b /src/ipcpd/unicast
parentf796e85856382b6beba5c108d74ecf9baf8bb773 (diff)
downloadouroboros-b7baa89fbaa04ceb3227d4d43089d8e6a5326b65.tar.gz
ouroboros-b7baa89fbaa04ceb3227d4d43089d8e6a5326b65.zip
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 <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd/unicast')
-rw-r--r--src/ipcpd/unicast/addr-auth/flat.c5
1 files changed, 4 insertions, 1 deletions
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;
}