summaryrefslogtreecommitdiff
path: root/zebra/interface.c
diff options
context:
space:
mode:
authorChris Caputo <ccaputo@alt.net>2009-05-03 04:40:57 +0000
committerPaul Jakma <paul@quagga.net>2009-06-23 14:15:57 +0100
commitb60668d092f1778395b6c10b406059b8cbf235b8 (patch)
tree7869d81a4a8d440f8cb41ddb0e66c8279e2b9636 /zebra/interface.c
parent5bc52c76c2816a3be9a033c3e5bf4fea1908e3cd (diff)
RFC 4191 Default Router Preference support for router advertisements
Adds "ipv6 nd router-preference (high|medium|low)" and "no ipv6 nd router-preference" interface commands. Files modified: doc/ipv6.texi zebra/interface.c zebra/interface.h zebra/rtadv.c zebra/rtadv.h Signed-off-by: Chris Caputo <ccaputo@alt.net>
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 3e4867c4..9dfb6d50 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -41,6 +41,11 @@
#include "zebra/debug.h"
#include "zebra/irdp.h"
+#ifdef 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 */
/* Called when new interface is added. */
static int
@@ -75,6 +80,7 @@ if_zebra_new_hook (struct interface *ifp)
rtadv->HomeAgentPreference = 0;
rtadv->HomeAgentLifetime = RTADV_ADV_DEFAULT_LIFETIME;
rtadv->AdvIntervalOption = 0;
+ rtadv->DefaultPreference = RTADV_PREF_MEDIUM;
rtadv->AdvPrefixList = list_new ();
}
@@ -622,6 +628,9 @@ nd_dump_vty (struct vty *vty, struct interface *ifp)
VTY_NEWLINE);
vty_out (vty, " ND router advertisements live for %d seconds%s",
rtadv->AdvDefaultLifetime, VTY_NEWLINE);
+ vty_out (vty, " ND router advertisement default router preference is "
+ "%s%s", rtadv_pref_strs[rtadv->DefaultPreference],
+ VTY_NEWLINE);
if (rtadv->AdvManagedFlag)
vty_out (vty, " Hosts use DHCP to obtain routable addresses.%s",
VTY_NEWLINE);