Check for RTA_TABLE in configure.
authorTobias Brunner <tobias@strongswan.org>
Tue, 4 Oct 2011 16:46:51 +0000 (18:46 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 4 Oct 2011 16:46:51 +0000 (18:46 +0200)
configure.in
src/libhydra/plugins/kernel_netlink/kernel_netlink_net.c

index 1f6529c..051b609 100644 (file)
@@ -459,6 +459,17 @@ AC_TRY_COMPILE(
        [AC_MSG_RESULT([no])]
 )
 
+AC_MSG_CHECKING([for RTA_TABLE])
+AC_TRY_COMPILE(
+       [#include <sys/socket.h>
+       #include <linux/netlink.h>
+       #include <linux/rtnetlink.h>],
+       [int rta_type = RTA_TABLE;
+        return rta_type;],
+       [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_RTA_TABLE])],
+       [AC_MSG_RESULT([no])]
+)
+
 AC_MSG_CHECKING([for gcc atomic operations])
 AC_TRY_RUN(
 [
index 9d67a60..2196575 100644 (file)
@@ -933,12 +933,14 @@ static host_t *get_route(private_kernel_netlink_net_t *this, host_t *dest,
                                                                rta_oif = *(u_int32_t*)RTA_DATA(rta);
                                                        }
                                                        break;
+#ifdef HAVE_RTA_TABLE
                                                case RTA_TABLE:
                                                        if (RTA_PAYLOAD(rta) == sizeof(rta_table))
                                                        {
                                                                rta_table = *(u_int32_t*)RTA_DATA(rta);
                                                        }
                                                        break;
+#endif /* HAVE_RTA_TABLE*/
                                        }
                                        rta = RTA_NEXT(rta, rtasize);
                                }