summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
Diffstat (limited to 'zebra')
-rw-r--r--zebra/ChangeLog11
-rw-r--r--zebra/kernel_socket.c4
-rw-r--r--zebra/main.c14
-rw-r--r--zebra/zebra_rib.c22
4 files changed, 39 insertions, 12 deletions
diff --git a/zebra/ChangeLog b/zebra/ChangeLog
index 9a26750f..55b11223 100644
--- a/zebra/ChangeLog
+++ b/zebra/ChangeLog
@@ -1,3 +1,14 @@
+2006-12-08 Piotr Chytla <pch@packetconsulting.pl>
+
+ * zebra_rib.c: (static_install_ipv{4,6}) Case where existing
+ RIB is updated must explicitely rib_addqueue the route_node,
+ to ensure the update actually takes effect.
+
+2006-09-13 Tom Everett <tom@khubla.com>
+
+ * kernel_socket.c (rtm_type_str): ifdef RTM_OLD{ADD,DEL} to
+ compile on systems that no longer define them.
+
2006-08-06 Paul Jakma <paul.jakma@sun.com>
* interface.h: (ifstat_update_proc) declaration should match
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index bd4d9c4b..f384e979 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -136,8 +136,12 @@ struct message rtm_type_str[] =
{RTM_REDIRECT, "RTM_REDIRECT"},
{RTM_MISS, "RTM_MISS"},
{RTM_LOCK, "RTM_LOCK"},
+#ifdef OLDADD
{RTM_OLDADD, "RTM_OLDADD"},
+#endif /* RTM_OLDADD */
+#ifdef RTM_OLDDEL
{RTM_OLDDEL, "RTM_OLDDEL"},
+#endif /* RTM_OLDDEL */
{RTM_RESOLVE, "RTM_RESOLVE"},
{RTM_NEWADDR, "RTM_NEWADDR"},
{RTM_DELADDR, "RTM_DELADDR"},
diff --git a/zebra/main.c b/zebra/main.c
index dbe1b537..ed45bd13 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -76,6 +76,7 @@ struct option longopts[] =
{ "vty_addr", required_argument, NULL, 'A'},
{ "vty_port", required_argument, NULL, 'P'},
{ "retain", no_argument, NULL, 'r'},
+ { "dryrun", no_argument, NULL, 'C'},
#ifdef HAVE_NETLINK
{ "nl-bufsize", required_argument, NULL, 's'},
#endif /* HAVE_NETLINK */
@@ -131,6 +132,7 @@ usage (char *progname, int status)
"-k, --keep_kernel Don't delete old routes which installed by "\
"zebra.\n"\
"-l, --log_mode Set verbose log mode flag\n"\
+ "-C, --dryrun Check configuration for validity and exit\n"\
"-A, --vty_addr Set vty's bind address\n"\
"-P, --vty_port Set vty's port number\n"\
"-r, --retain When program terminates, retain added route "\
@@ -208,6 +210,7 @@ main (int argc, char **argv)
char *p;
char *vty_addr = NULL;
int vty_port = ZEBRA_VTY_PORT;
+ int dryrun = 0;
int batch_mode = 0;
int daemon_mode = 0;
char *config_file = NULL;
@@ -228,9 +231,9 @@ main (int argc, char **argv)
int opt;
#ifdef HAVE_NETLINK
- opt = getopt_long (argc, argv, "bdklf:i:hA:P:ru:g:vs:", longopts, 0);
+ opt = getopt_long (argc, argv, "bdklf:i:hA:P:ru:g:vs:C", longopts, 0);
#else
- opt = getopt_long (argc, argv, "bdklf:i:hA:P:ru:g:v", longopts, 0);
+ opt = getopt_long (argc, argv, "bdklf:i:hA:P:ru:g:vC", longopts, 0);
#endif /* HAVE_NETLINK */
if (opt == EOF)
@@ -248,6 +251,9 @@ main (int argc, char **argv)
case 'k':
keep_kernel_mode = 1;
break;
+ case 'C':
+ dryrun = 1;
+ break;
case 'l':
/* log_mode = 1; */
break;
@@ -345,6 +351,10 @@ main (int argc, char **argv)
/* Configuration file read*/
vty_read_config (config_file, config_default);
+ /* Don't start execution if we are in dry-run mode */
+ if (dryrun)
+ return(0);
+
/* Clean up rib. */
rib_weed_tables ();
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 8d4e732c..64d23199 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1103,20 +1103,20 @@ rib_queue_init (struct zebra_t *zebra)
* The queue length is bounded by the maximal size of the routing table,
* as a route_node will not be requeued, if already queued.
*
- * RIBs are submitted via rib_addnode and rib_delnode, which set
- * minimal state and then submit route_node to queue for best-path
- * selection later. Order of add/delete state changes are preserved for
- * any given RIB.
+ * RIBs are submitted via rib_addnode or rib_delnode which set minimal
+ * state, or static_install_ipv{4,6} (when an existing RIB is updated)
+ * and then submit route_node to queue for best-path selection later.
+ * Order of add/delete state changes are preserved for any given RIB.
*
* Deleted RIBs are reaped during best-path selection.
*
* rib_addnode
* |-> rib_link or unset RIB_ENTRY_REMOVE |->Update kernel with
- * |-> rib_addqueue | best RIB, if required
- * | |
- * |-> .......................... -> rib_process
- * | |
- * |-> rib_addqueue |-> rib_unlink
+ * |-------->| | best RIB, if required
+ * | |
+ * static_install->|->rib_addqueue...... -> rib_process
+ * | |
+ * |-------->| |-> rib_unlink
* |-> set RIB_ENTRY_REMOVE |
* rib_delnode (RIB freed)
*
@@ -1557,6 +1557,7 @@ static_install_ipv4 (struct prefix *p, struct static_ipv4 *si)
nexthop_blackhole_add (rib);
break;
}
+ rib_queue_add (&zebrad, rn);
}
else
{
@@ -1721,7 +1722,7 @@ static_add_ipv4 (struct prefix *p, struct in_addr *gate, const char *ifname,
}
}
- /* Distance chaged. */
+ /* Distance changed. */
if (update)
static_delete_ipv4 (p, gate, ifname, update->distance, vrf_id);
@@ -2118,6 +2119,7 @@ static_install_ipv6 (struct prefix *p, struct static_ipv6 *si)
nexthop_ipv6_ifname_add (rib, &si->ipv6, si->ifname);
break;
}
+ rib_queue_add (&zebrad, rn);
}
else
{