Merge pull request #332 from ecsv/batadv-2017.4
[feed/routing.git] / mrd6 / patches / 002-missing_netlink_defs.patch
1 --- /dev/null
2 +++ b/include/mrdpriv/linux/netlink_missing_defs.h
3 @@ -0,0 +1,41 @@
4 +#include <linux/version.h>
5 +
6 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
7 +
8 +#include <linux/if_link.h>
9 +#include <linux/if_addr.h>
10 +#include <linux/neighbour.h>
11 +
12 +#ifndef IFA_RTA
13 +#define IFA_RTA(r) \
14 + ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
15 +#endif
16 +#ifndef IFA_PAYLOAD
17 +#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
18 +#endif
19 +
20 +#ifndef IFLA_RTA
21 +#define IFLA_RTA(r) \
22 + ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
23 +#endif
24 +#ifndef IFLA_PAYLOAD
25 +#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
26 +#endif
27 +
28 +#ifndef NDA_RTA
29 +#define NDA_RTA(r) \
30 + ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
31 +#endif
32 +#ifndef NDA_PAYLOAD
33 +#define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg))
34 +#endif
35 +
36 +#ifndef NDTA_RTA
37 +#define NDTA_RTA(r) \
38 + ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndtmsg))))
39 +#endif
40 +#ifndef NDTA_PAYLOAD
41 +#define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg))
42 +#endif
43 +
44 +#endif
45 --- a/src/linux/linux_unicast_route.cpp
46 +++ b/src/linux/linux_unicast_route.cpp
47 @@ -23,6 +23,7 @@
48 */
49
50 #include <mrdpriv/linux/unicast_route.h>
51 +#include <mrdpriv/linux/netlink_missing_defs.h>
52
53 #include <mrd/mrd.h>
54 #include <mrd/interface.h>