]> www.average.org Git - psmb.git/commitdiff
use 'struct in6_pktinfo' from linux/ipv6.h master
authorEugene Crosser <evgenii.cherkashin@cloud.ionos.com>
Thu, 4 Apr 2019 13:00:36 +0000 (15:00 +0200)
committerEugene Crosser <evgenii.cherkashin@cloud.ionos.com>
Thu, 4 Apr 2019 13:00:36 +0000 (15:00 +0200)
Getting the definition of the structure is system-dependent :(
For now, use Linux header unconditionally.

Signed-off-by: Eugene Crosser <evgenii.cherkashin@profitbricks.com>
src/Makefile
src/psmb_socket.c

index c115768a2540ed8a62b22bb0393b5ca004efe1e2..adda87352ad9e7c09f8734b92cd6345d12df2ffb 100644 (file)
@@ -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
 ARFLAGS = rcsv
 
 LIB = libpsmb.a
index 41564a0279abacebdeb870c8319035e40bf23ac0..a68b1ebd995144e23f2cf7cff432cba50b8eecd7 100644 (file)
 #include "psmb_priv.h"
 #include "hash64.h"
 
 #include "psmb_priv.h"
 #include "hash64.h"
 
-/* #include <linux/ipv6.h> // should give us this definition */
+#include <linux/ipv6.h> /* 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;
 };
 struct in6_pktinfo {
        struct in6_addr ipi6_addr;
        int             ipi6_ifindex;
 };
+*/
 
 static void dummy_log(void *log_priv, int priority, const char *format, ...) {}
 
 
 static void dummy_log(void *log_priv, int priority, const char *format, ...) {}