3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2026-02-11 06:58:04 +01:00

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];
      |              ^~~~~~~~
This commit is contained in:
Marcel Holtmann 2026-02-10 09:22:57 +01:00
parent fd0f14b164
commit 1c7933296b

View File

@ -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>