]> git.puffer.fish Git - mirror/frr.git/commitdiff
babeld: state-file was loaded too early. Initial seqno too.
authorMatthieu Boutier <boutier@pps.jussieu.fr>
Sat, 28 Jan 2012 09:35:12 +0000 (10:35 +0100)
committerPaul Jakma <paul@quagga.net>
Sun, 25 Mar 2012 16:06:53 +0000 (17:06 +0100)
babeld/babel_main.c
babeld/babel_main.h
babeld/babeld.c

index c039c880e3f527dfac97caf9e3852c639a9e4fe0..951da7d19730f3b7c2be0af9c3662bc6248fe092 100644 (file)
@@ -68,7 +68,6 @@ static char *babel_get_progname(char *argv_0);
 static void babel_fail(void);
 static void babel_init_random(void);
 static void babel_replace_by_null(int fd);
-static void babel_load_state_file(void);
 static void babel_init_signals(void);
 static void babel_exit_properly(void);
 static void babel_save_state_file(void);
@@ -304,9 +303,6 @@ babel_init(int argc, char **argv)
     zlog_set_level (NULL, ZLOG_DEST_STDOUT, ZLOG_DISABLED);
     vty_read_config (babel_config_file, babel_config_default);
 
-    myseqno = (random() & 0xFFFF);
-    babel_load_state_file();
-
     /* Create VTY socket */
     vty_serv_sock (babel_vty_addr, babel_vty_port, BABEL_VTYSH_PATH);
 
@@ -380,7 +376,7 @@ babel_replace_by_null(int fd)
  Load the state file: check last babeld's running state, usefull in case of
  "/etc/init.d/babeld restart"
  */
-static void
+void
 babel_load_state_file(void)
 {
     time_t reboot_time;
index fb22c58e2a884dcffe683474da36306a6314dd11..2afebc9e99706e26a46158dba0b70de2ee4c9087 100644 (file)
@@ -54,4 +54,5 @@ extern int protocol_socket;
 extern int kernel_socket;
 extern int max_request_hopcount;
 
+void babel_load_state_file(void);
 void show_babel_main_configuration (struct vty *vty);
index d69662c00d4a23ad5bff3a317a6cc482fa03b490..33b5d9e12a688b0edd2ee92cbcea78181a6e6cfe 100644 (file)
@@ -173,7 +173,9 @@ babel_read_protocol (struct thread *thread)
 static int
 babel_init_routing_process(struct thread *thread)
 {
+    myseqno = (random() & 0xFFFF);
     babel_get_myid();
+    babel_load_state_file();
     debugf(BABEL_DEBUG_COMMON, "My ID is : %s.", format_eui64(myid));
     babel_initial_noise();
     babel_main_loop(thread);/* this function self-add to the t_update thread */