From 75f1349106337324be2bac244b699189e9312e2f Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 15 Apr 2016 13:09:58 -0400 Subject: [PATCH] quagga: Check for existence of IFLA_INFO_SLAVE_KIND IFLA_INFO_SLAVE_KIND is a new type of netlink message If the kernel makes it available compile in support else we'll just silently do the right thing. Additionally reduce the test cases for netlink by 1 Signed-off-by: Donald Sharp Reviewed-by: David Ahern Reviewed-by: Don Slice Reviewed-by: Vivek Venkatraman --- configure.ac | 8 ++------ zebra/rt_netlink.c | 4 ++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 718bd2d03c..5257b411d3 100755 --- a/configure.ac +++ b/configure.ac @@ -837,12 +837,7 @@ dnl Determine routing get and set method dnl ------------------------------------ AC_MSG_CHECKING(zebra between kernel interface method) if test x"$opsys" = x"gnu-linux"; then - if test "${enable_netlink}" = "yes";then - AC_MSG_RESULT(netlink) - RT_METHOD=rt_netlink.o - AC_DEFINE(HAVE_NETLINK,,netlink) - netlink=yes - elif test "${enable_netlink}" = "no"; then + if test "${enable_netlink}" = "no"; then AC_MSG_RESULT(ioctl) RT_METHOD=rt_ioctl.o netlink=no @@ -851,6 +846,7 @@ if test x"$opsys" = x"gnu-linux"; then RT_METHOD=rt_netlink.o AC_DEFINE(HAVE_NETLINK,,netlink) netlink=yes + AC_CHECK_DECLS([IFLA_INFO_SLAVE_KIND], [], [], [#include ]) fi elif test x"$opsys" = x"sol2-6";then AC_MSG_RESULT(Route socket) diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 78364f6f4a..8fb75640e8 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -654,8 +654,10 @@ netlink_interface (struct sockaddr_nl *snl, struct nlmsghdr *h, if (linkinfo[IFLA_INFO_KIND]) kind = RTA_DATA(linkinfo[IFLA_INFO_KIND]); +#if HAVE_DECL_IFLA_INFO_SLAVE_KIND if (linkinfo[IFLA_INFO_SLAVE_KIND]) slave_kind = RTA_DATA(linkinfo[IFLA_INFO_SLAVE_KIND]); +#endif if (kind && strcmp(kind, "vrf") == 0) { @@ -1304,8 +1306,10 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h, if (linkinfo[IFLA_INFO_KIND]) kind = RTA_DATA(linkinfo[IFLA_INFO_KIND]); +#if HAVE_DECL_IFLA_INFO_SLAVE_KIND if (linkinfo[IFLA_INFO_SLAVE_KIND]) slave_kind = RTA_DATA(linkinfo[IFLA_INFO_SLAVE_KIND]); +#endif if (kind && strcmp(kind, "vrf") == 0) { -- 2.39.5