diff options
author | Nathan Moos <nmoos@cisco.com> | 2021-01-15 16:45:14 -0800 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2021-01-21 13:08:57 +0000 |
commit | 323418dd1c7825d38e8b1f83d5a8c23766a26de2 (patch) | |
tree | 8db40b41eccf9e122e3ec25637e4ce94edca6e9d /src/vppinfra/socket.c | |
parent | 1523c96deb2bc2f03e7823be4545342309da18fc (diff) |
vppinfra: ensure _GNU_SOURCE is present
Type: fix
When building with musl, _GNU_SOURCE is required to be defined in more
places. This patch defines it in those required places. Additionally,
this patch changes the udphdr field names to the standard names.
Change-Id: I0fec54214ccc8458289176488afb4218761e9d51
Signed-off-by: Nathan Moos <nmoos@cisco.com>
Diffstat (limited to 'src/vppinfra/socket.c')
-rw-r--r-- | src/vppinfra/socket.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vppinfra/socket.c b/src/vppinfra/socket.c index 32260614942..3271393529d 100644 --- a/src/vppinfra/socket.c +++ b/src/vppinfra/socket.c @@ -38,6 +38,7 @@ #include <stdio.h> #include <string.h> /* strchr */ #define __USE_GNU +#define _GNU_SOURCE #include <sys/types.h> #include <sys/socket.h> #include <sys/un.h> @@ -54,6 +55,11 @@ #include <vppinfra/format.h> #include <vppinfra/error.h> +#ifndef __GLIBC__ +/* IPPORT_USERRESERVED is not part of musl libc. */ +#define IPPORT_USERRESERVED 5000 +#endif + __clib_export void clib_socket_tx_add_formatted (clib_socket_t * s, char *fmt, ...) { |