Added linux version checking in flowlabel.h

The current version of src/flowlabel.h is just a copy of linux/in6.h because it conflicts with "netinet/in.h".
But after linux >=v3.7 (adding uapi) this conflict was removed and this copy became useless.
I've added a Linux version check.
This fix is very useful for eg mp-tcp linux where iperf can build successfully.
This commit is contained in:
Arseney300 2022-04-06 02:13:46 +07:00
parent 0ecdfdda80
commit 3ea0269f50

View File

@ -29,15 +29,18 @@
#include <linux/types.h>
#include <linux/version.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
#include <linux/in6.h>
#else
#ifndef __ANDROID__
/*
It is just a stripped copy of the Linux kernel header "linux/in6.h"
"Flow label" things are still not defined in "netinet/in*.h" headers,
but we cannot use "linux/in6.h" immediately because it currently
conflicts with "netinet/in.h" .
conflicts with "netinet/in.h" . (in kernel versions < 3.7.0)
*/
#ifndef __ANDROID__
struct in6_flowlabel_req
{
struct in6_addr flr_dst;
@ -68,6 +71,7 @@ struct in6_flowlabel_req
#define IPV6_FLOWINFO_FLOWLABEL 0x000fffff
#define IPV6_FLOWINFO_PRIORITY 0x0ff00000
#endif
#define IPV6_FLOWLABEL_MGR 32
#define IPV6_FLOWINFO_SEND 33