]> git.puffer.fish Git - mirror/frr.git/commitdiff
Quagga: Cleanup RTADV define
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 20 Nov 2015 13:33:30 +0000 (08:33 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 20 Nov 2015 15:07:41 +0000 (07:07 -0800)
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>
zebra/interface.c
zebra/interface.h
zebra/main.c
zebra/rib.h
zebra/rtadv.c
zebra/rtadv.h

index a3d297d327b6eba753a60e94ef1f0d59d0788ea0..884dfedd9eb90022b72c8bdd0aee555fcd6cef6a 100644 (file)
 
 #define ZEBRA_PTM_SUPPORT
 
-#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
@@ -66,7 +66,7 @@ if_zebra_new_hook (struct interface *ifp)
   zebra_if->shutdown = IF_ZEBRA_SHUTDOWN_OFF;
 
   ifp->ptm_enable = zebra_ptm_get_enable_state();
-#ifdef RTADV
+#if defined (HAVE_RTADV)
   {
     /* Set default router advertise values. */
     struct rtadvconf *rtadv;
@@ -92,7 +92,7 @@ if_zebra_new_hook (struct interface *ifp)
 
     rtadv->AdvPrefixList = list_new ();
   }    
-#endif /* RTADV */
+#endif /* HAVE_RTADV */
 
   /* Initialize installed address chains tree. */
   zebra_if->ipv4_subnets = route_table_init ();
@@ -753,7 +753,7 @@ nbr_connected_dump_vty (struct vty *vty, struct nbr_connected *connected)
   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)
@@ -814,7 +814,7 @@ nd_dump_vty (struct vty *vty, struct interface *ifp)
                 VTY_NEWLINE);
     }
 }
-#endif /* RTADV */
+#endif /* HAVE_RTADV */
 
 /* Interface's information print out to vty interface. */
 static void
@@ -924,9 +924,9 @@ if_dump_vty (struct vty *vty, struct interface *ifp)
        connected_dump_vty (vty, connected);
     }
 
-#ifdef RTADV
+#if defined (HAVE_RTADV)
   nd_dump_vty (vty, ifp);
-#endif /* RTADV */
+#endif /* HAVE_RTADV */
   if (listhead(ifp->nbr_connected))
     vty_out (vty, "  Neighbor address(s):%s", VTY_NEWLINE);
   for (ALL_LIST_ELEMENTS_RO (ifp->nbr_connected, node, nbr_connected))
@@ -1912,9 +1912,9 @@ if_config_write (struct vty *vty)
                     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);
index ba76d3e8451da79c21ae2795739b801e37bd9df9..650b62a45866a6f739a698f93a5a19e354884b1b 100644 (file)
 #define IF_ZEBRA_SHUTDOWN_OFF    0
 #define IF_ZEBRA_SHUTDOWN_ON     1
 
-/* Router advertisement feature. */
-#ifndef RTADV
-#if (defined(LINUX_IPV6) && (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 @@ struct rtadvconf
 #define RTADV_PREF_MEDIUM 0x0 /* Per RFC4191. */
 };
 
-#endif /* RTADV */
+#endif /* HAVE_RTADV */
 
 /* `zebra' daemon local interface structure. */
 struct zebra_if
@@ -197,9 +188,9 @@ struct zebra_if
   /* Installed addresses chains tree. */
   struct route_table *ipv4_subnets;
 
-#ifdef RTADV
+#if defined(HAVE_RTADV)
   struct rtadvconf rtadv;
-#endif /* RTADV */
+#endif /* HAVE_RTADV */
 
 #ifdef HAVE_IRDP
   struct irdp_interface irdp;
index 4b2a89856ed5755cb705c7f9f0cf6d9b68fa17d9..8048eba71e8ed630d0b0d0f4de16c6e201d76f85 100644 (file)
@@ -238,7 +238,7 @@ zebra_vrf_enable (vrf_id_t vrf_id, void **info)
 
   assert (zvrf);
 
-#ifdef RTADV
+#if defined (HAVE_RTADV)
   rtadv_init (zvrf);
 #endif
   kernel_init (zvrf);
@@ -269,7 +269,7 @@ zebra_vrf_disable (vrf_id_t vrf_id, void **info)
         if_down (ifp);
     }
 
-#ifdef RTADV
+#if defined (HAVE_RTADV)
   rtadv_terminate (zvrf);
 #endif
   kernel_terminate (zvrf);
@@ -417,7 +417,7 @@ main (int argc, char **argv)
   zebra_vty_init ();
   access_list_init ();
   prefix_list_init ();
-#ifdef RTADV
+#if defined (HAVE_RTADV)
   rtadv_cmd_init ();
 #endif
 #ifdef HAVE_IRDP
index 3656646c9b473bac2c9575151a5b68b163fe0262..1f045310a57c314afb6c6533bd4d52fc5c451226 100644 (file)
@@ -259,16 +259,7 @@ struct static_route
                                       : ((tnexthop) = (nexthop)->next)) \
                        : (((recursing) = 0),((tnexthop) = (tnexthop)->next)))
 
-/* Router advertisement feature. */
-#ifndef RTADV
-#if (defined(LINUX_IPV6) && (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1)) || defined(KAME)
-  #ifdef HAVE_RTADV
-    #define RTADV
-  #endif
-#endif
-#endif
-
-#if defined (RTADV)
+#if defined (HAVE_RTADV)
 /* Structure which hold status of router advertisement. */
 struct rtadv
 {
@@ -280,7 +271,7 @@ struct rtadv
   struct thread *ra_read;
   struct thread *ra_timer;
 };
-#endif /* RTADV */
+#endif /* HAVE_RTADV */
 
 #ifdef HAVE_NETLINK
 /* Socket interface to kernel */
@@ -338,9 +329,9 @@ struct zebra_vrf
   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 */
 };
 
 /*
index d48f804f77f31f68327fb62d386f284a72324740..29a29c4044cdfbe7d825cd5fe0d13282a583bb77 100644 (file)
@@ -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>
@@ -1863,4 +1863,4 @@ rtadv_cmd_init (void)
 {
   /* Empty.*/;
 }
-#endif /* RTADV && HAVE_IPV6 */
+#endif /* HAVE_RTADV && HAVE_IPV6 */
index 76f98cf2c876da5e5f254db6d548981cb525182f..160814b2099b8cca9f81993a0347711381f487d1 100644 (file)
@@ -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 @@ struct nd_opt_homeagent_info {  /* Home Agent info */
 
 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 *);