Commit 9692a213 authored by Jörg Krause's avatar Jörg Krause Committed by Christophe Massiot

Fix musl build

Defining _GNU_SOURCE is required to get proper member names in `struct udphdr`
when building against musl. Build error:

  util.c: In function 'RawFillHeaders':
  util.c:481:9: error: 'struct udphdr' has no member named 'source'
       udph->source = htons(portsrc);
           ^
  util.c:482:9: error: 'struct udphdr' has no member named 'dest'
       udph->dest   = htons(portdst);
           ^
  util.c:483:9: error: 'struct udphdr' has no member named 'len'
       udph->len    = htons(sizeof(struct udphdr) + len);
           ^
  util.c:484:9: error: 'struct udphdr' has no member named 'check'
       udph->check  = 0;

Including <sys/types.h> in needed for mode_t, otherwise musl build fails:
  util.h:91:1: error: unknown type name 'mode_t'
Signed-off-by: default avatarJörg Krause <joerg.krause@embedded.rocks>
parent 03366906
......@@ -21,6 +21,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment