Fix the libwrap dependency for srelay (#2175)
[openwrt/svn-archive/archive.git] / net / srelay / patches / 002-linux_2.6.19_rtnetlink_changes.patch
1 diff -ruN srelay-0.4.6-old/get-bind.c srelay-0.4.6-new/get-bind.c
2 --- srelay-0.4.6-old/get-bind.c 2003-04-10 04:53:17.000000000 +0200
3 +++ srelay-0.4.6-new/get-bind.c 2006-12-18 12:53:06.000000000 +0100
4 @@ -50,6 +50,18 @@
5 #include <asm/types.h>
6 #include <linux/netlink.h>
7 #include <linux/rtnetlink.h>
8 +#include <linux/version.h>
9 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
10 +# include <linux/if_addr.h>
11 +#endif
12 +#ifndef IFA_RTA
13 +# define IFA_RTA(r) ((struct rtattr *) ((char *)(r) + NLMSG_ALIGN (sizeof (struct ifaddrmsg))))
14 +# define IFA_PAYLOAD(n) NLMSG_PAYLOAD (n, sizeof (struct ifaddrmsg))
15 +#endif
16 +#ifndef IFLA_RTA
17 +# define IFLA_RTA(r) ((struct rtattr *) ((char *)(r) + NLMSG_ALIGN (sizeof (struct ifinfomsg))))
18 +# define IFLA_PAYLOAD(n) NLMSG_PAYLOAD (n, sizeof (struct ifinfomsg))
19 +#endif
20
21 static int get_ifconf(int, struct addrinfo *);
22 #endif /* defined(LINUX) */