commit 1c7933296b4bf53057c8f3ab4c79635bed225c75
parent fd0f14b164dba288a73155fadcf894542795eb8f
Author: Marcel Holtmann <marcel@holtmann.org>
Date: Tue, 10 Feb 2026 09:22:57 +0100
p2p: Fix build issue with missing _GNU_SOURCE
CC src/p2p.o
src/p2p.c: In function ‘p2p_connection_reset’:
src/p2p.c:643:17: error: implicit declaration of function ‘explicit_bzero’ [-Wimplicit-function-declaration]
643 | explicit_bzero(dev->conn_pin, strlen(dev->conn_pin));
| ^~~~~~~~~~~~~~
src/p2p.c: In function ‘p2p_device_update_from_genl’:
src/p2p.c:4342:23: error: ‘HOST_NAME_MAX’ undeclared (first use in this function); did you mean ‘XATTR_NAME_MAX’?
4342 | char hostname[HOST_NAME_MAX + 1];
| ^~~~~~~~~~~~~
| XATTR_NAME_MAX
src/p2p.c:4342:23: note: each undeclared identifier is reported only once for each function it appears in
src/p2p.c:4376:9: error: implicit declaration of function ‘gethostname’; did you mean ‘getsockname’? [-Wimplicit-function-declaration]
4376 | gethostname(hostname, sizeof(hostname));
| ^~~~~~~~~~~
| getsockname
src/p2p.c:4342:14: error: unused variable ‘hostname’ [-Werror=unused-variable]
4342 | char hostname[HOST_NAME_MAX + 1];
| ^~~~~~~~
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/p2p.c b/src/p2p.c
@@ -24,6 +24,7 @@
#include <config.h>
#endif
+#define _GNU_SOURCE
#include <stdlib.h>
#include <linux/rtnetlink.h>
#include <linux/if_ether.h>
@@ -35,6 +36,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <linux/if.h>
+#include <sys/param.h>
#include <ell/ell.h>