From: Eugene Crosser Date: Thu, 4 Apr 2019 13:00:36 +0000 (+0200) Subject: use 'struct in6_pktinfo' from linux/ipv6.h X-Git-Url: http://www.average.org/gitweb/?p=psmb.git;a=commitdiff_plain;h=HEAD;ds=sidebyside use 'struct in6_pktinfo' from linux/ipv6.h Getting the definition of the structure is system-dependent :( For now, use Linux header unconditionally. Signed-off-by: Eugene Crosser --- diff --git a/src/Makefile b/src/Makefile index c115768..adda873 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,4 +1,5 @@ -CFLAGS = -pthread -Wall -I../include +# -D_GNU_SOURCE needed for `struct in6_pktinfo` to be defined in linux/ipv6.h +CFLAGS = -pthread -Wall -I../include -D_GNU_SOURCE ARFLAGS = rcsv LIB = libpsmb.a diff --git a/src/psmb_socket.c b/src/psmb_socket.c index 41564a0..a68b1eb 100644 --- a/src/psmb_socket.c +++ b/src/psmb_socket.c @@ -12,11 +12,14 @@ #include "psmb_priv.h" #include "hash64.h" -/* #include // should give us this definition */ +#include /* contains definition of `struct in6_pktinfo`, */ + /* but only if _GNU_SOURCE is defined. Arrgh! */ +/* The structure itself *should* be like this: struct in6_pktinfo { struct in6_addr ipi6_addr; int ipi6_ifindex; }; +*/ static void dummy_log(void *log_priv, int priority, const char *format, ...) {}