• Jörg Krause's avatar
    Fix musl build · 9692a213
    Jörg Krause authored
    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: 's avatarJörg Krause <joerg.krause@embedded.rocks>
    9692a213
util.c 38.3 KB