1
0
Fork 0
mirror of https://git.freebsd.org/ports.git synced 2025-07-14 15:59:18 -04:00
ports/net/quagga/files/patch-cvs-3-rib_sweep_route
Sergey Matveychuk b7d737ee9d - Update to 0.99.9 + patches from quagga CVS
Approved by:	maintainer
2007-09-24 07:59:16 +00:00

39 lines
1.4 KiB
Text

--- zebra/main.c 2007-05-02 19:28:33.000000000 +0400
+++ zebra/main.c 2007-09-14 17:34:12.000000000 +0400
@@ -346,11 +346,13 @@
zebra_snmp_init ();
#endif /* HAVE_SNMP */
- /* Clean up self inserted route. */
- if (! keep_kernel_mode)
- rib_sweep_route ();
-
- /* Configuration file read*/
+ /* Process the configuration file. Among other configuration
+ * directives we can meet those installing static routes. Such
+ * requests will not be executed immediately, but queued in
+ * zebra->ribq structure until we enter the main execution loop.
+ * The notifications from kernel will show originating PID equal
+ * to that after daemon() completes (if ever called).
+ */
vty_read_config (config_file, config_default);
/* Don't start execution if we are in dry-run mode */
@@ -374,6 +376,17 @@
/* Output pid of zebra. */
pid_output (pid_file);
+ /* After we have successfully acquired the pidfile, we can be sure
+ * about being the only copy of zebra process, which is submitting
+ * changes to the FIB.
+ * Clean up zebra-originated routes. The requests will be sent to OS
+ * immediately, so originating PID in notifications from kernel
+ * will be equal to the current getpid(). To know about such routes,
+ * we have to have route_read() called before.
+ */
+ if (! keep_kernel_mode)
+ rib_sweep_route ();
+
/* Needed for BSD routing socket. */
pid = getpid ();