zebra: Cleanup RTADV define
The RTADV define was not being set correctly or consistently.
Make the code consistent with our HAVE_IPV6 define.
If the user wants to explicitly turn it off then they should
run --disable-rtadv from the configure cli
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
diff --git a/zebra/interface.c b/zebra/interface.c
index 162439f..411712d 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -42,11 +42,11 @@
#include "zebra/debug.h"
#include "zebra/irdp.h"
-#ifdef RTADV
+#if defined (HAVE_RTADV)
/* Order is intentional. Matches RFC4191. This array is also used for
command matching, so only modify with care. */
const char *rtadv_pref_strs[] = { "medium", "high", "INVALID", "low", 0 };
-#endif /* RTADV */
+#endif /* HAVE_RTADV */
/* Called when new interface is added. */
static int
@@ -59,7 +59,7 @@
zebra_if->multicast = IF_ZEBRA_MULTICAST_UNSPEC;
zebra_if->shutdown = IF_ZEBRA_SHUTDOWN_OFF;
-#ifdef RTADV
+#if defined (HAVE_RTADV)
{
/* Set default router advertise values. */
struct rtadvconf *rtadv;
@@ -85,7 +85,7 @@
rtadv->AdvPrefixList = list_new ();
}
-#endif /* RTADV */
+#endif /* HAVE_RTADV */
/* Initialize installed address chains tree. */
zebra_if->ipv4_subnets = route_table_init ();
@@ -638,7 +638,7 @@
vty_out (vty, "%s", VTY_NEWLINE);
}
-#ifdef RTADV
+#if defined (HAVE_RTADV)
/* Dump interface ND information to vty. */
static void
nd_dump_vty (struct vty *vty, struct interface *ifp)
@@ -699,7 +699,7 @@
VTY_NEWLINE);
}
}
-#endif /* RTADV */
+#endif /* HAVE_RTADV */
/* Interface's information print out to vty interface. */
static void
@@ -806,9 +806,9 @@
connected_dump_vty (vty, connected);
}
-#ifdef RTADV
+#if defined (HAVE_RTADV)
nd_dump_vty (vty, ifp);
-#endif /* RTADV */
+#endif /* HAVE_RTADV */
#ifdef HAVE_PROC_NET_DEV
/* Statistics print out using proc file system. */
@@ -1782,9 +1782,9 @@
VTY_NEWLINE);
}
-#ifdef RTADV
+#if defined (HAVE_RTADV)
rtadv_config_write (vty, ifp);
-#endif /* RTADV */
+#endif /* HAVE_RTADV */
#ifdef HAVE_IRDP
irdp_config_write (vty, ifp);
diff --git a/zebra/interface.h b/zebra/interface.h
index fe24604..936156e 100644
--- a/zebra/interface.h
+++ b/zebra/interface.h
@@ -37,16 +37,7 @@
#define IF_ZEBRA_SHUTDOWN_OFF 0
#define IF_ZEBRA_SHUTDOWN_ON 1
-/* Router advertisement feature. */
-#ifndef RTADV
-#if (defined(LINUX_IPV6) && (!defined(__GLIBC__) || defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1)) || defined(KAME)
- #ifdef HAVE_RTADV
- #define RTADV
- #endif
-#endif
-#endif
-
-#ifdef RTADV
+#if defined (HAVE_RTADV)
/* Router advertisement parameter. From RFC4861, RFC6275 and RFC4191. */
struct rtadvconf
{
@@ -180,7 +171,7 @@
#define RTADV_PREF_MEDIUM 0x0 /* Per RFC4191. */
};
-#endif /* RTADV */
+#endif /* HAVE_RTADV */
/* `zebra' daemon local interface structure. */
struct zebra_if
@@ -197,7 +188,7 @@
/* Installed addresses chains tree. */
struct route_table *ipv4_subnets;
-#ifdef RTADV
+#if defined(HAVE_RTADV)
struct rtadvconf rtadv;
#endif /* RTADV */
diff --git a/zebra/main.c b/zebra/main.c
index c5d1d76..f3c08f1 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -229,7 +229,7 @@
assert (zvrf);
-#ifdef RTADV
+#if defined (HAVE_RTADV)
rtadv_init (zvrf);
#endif
kernel_init (zvrf);
@@ -260,7 +260,7 @@
if_down (ifp);
}
-#ifdef RTADV
+#if defined (HAVE_RTADV)
rtadv_terminate (zvrf);
#endif
kernel_terminate (zvrf);
@@ -405,7 +405,7 @@
zebra_vty_init ();
access_list_init ();
prefix_list_init ();
-#ifdef RTADV
+#if defined (HAVE_RTADV)
rtadv_cmd_init ();
#endif
#ifdef HAVE_IRDP
diff --git a/zebra/rib.h b/zebra/rib.h
index 1d3c15c..ffe7e2f 100644
--- a/zebra/rib.h
+++ b/zebra/rib.h
@@ -304,12 +304,8 @@
vrf_id_t vrf_id;
};
-/* Router advertisement feature. */
-#if !defined(RTADV) && defined(LINUX_IPV6) && defined(HAVE_RTADV)
-# define RTADV
-#endif
-#if defined (RTADV)
+#if defined (HAVE_RTADV)
/* Structure which hold status of router advertisement. */
struct rtadv
{
@@ -321,7 +317,7 @@
struct thread *ra_read;
struct thread *ra_timer;
};
-#endif /* RTADV */
+#endif /* HAVE_RTADV */
#ifdef HAVE_NETLINK
/* Socket interface to kernel */
@@ -370,9 +366,9 @@
struct list *rid_lo_sorted_list;
struct prefix rid_user_assigned;
-#if defined (RTADV)
+#if defined (HAVE_RTADV)
struct rtadv rtadv;
-#endif /* RTADV */
+#endif /* HAVE_RTADV */
};
/*
diff --git a/zebra/rtadv.c b/zebra/rtadv.c
index f5d5b4a..6b49cf6 100644
--- a/zebra/rtadv.c
+++ b/zebra/rtadv.c
@@ -41,7 +41,7 @@
extern struct zebra_privs_t zserv_privs;
-#if defined (HAVE_IPV6) && defined (RTADV)
+#if defined (HAVE_IPV6) && defined (HAVE_RTADV)
#ifdef OPEN_BSD
#include <netinet/icmp6.h>
@@ -1813,4 +1813,4 @@
{
/* Empty.*/;
}
-#endif /* RTADV && HAVE_IPV6 */
+#endif /* HAVE_RTADV && HAVE_IPV6 */
diff --git a/zebra/rtadv.h b/zebra/rtadv.h
index 76f98cf..160814b 100644
--- a/zebra/rtadv.h
+++ b/zebra/rtadv.h
@@ -27,7 +27,7 @@
#include "zebra/interface.h"
/* NB: RTADV is defined in zebra/interface.h above */
-#ifdef RTADV
+#if defined (HAVE_RTADV)
/* Router advertisement prefix. */
struct rtadv_prefix
@@ -98,7 +98,7 @@
extern const char *rtadv_pref_strs[];
-#endif /* RTADV */
+#endif /* HAVE_RTADV */
extern void rtadv_init (struct zebra_vrf *);
extern void rtadv_terminate (struct zebra_vrf *);