]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Config: Removed obsolete force_restart option when commiting
authorMaria Matejka <mq@ucw.cz>
Thu, 13 Jun 2024 13:36:18 +0000 (15:36 +0200)
committerMaria Matejka <mq@ucw.cz>
Fri, 14 Jun 2024 21:16:07 +0000 (23:16 +0200)
conf/conf.c
conf/conf.h
nest/proto.c
nest/protocol.h
sysdep/unix/main.c
test/birdtest.c

index a7dc7edc4ea7ca0b65d2447b1dab93bc576ccedb..02a750a4b5fc056681a8bb7bdf52c6e710dd7228 100644 (file)
@@ -243,11 +243,11 @@ config_del_obstacle(struct config *c)
     ev_send_loop(&main_birdloop, &c->done_event);
 }
 
-static int
+static void
 global_commit(struct config *new, struct config *old)
 {
   if (!old)
-    return 0;
+    return;
 
   if (!new->router_id)
     {
@@ -262,8 +262,6 @@ global_commit(struct config *new, struct config *old)
            new->router_id = id;
        }
     }
-
-  return 0;
 }
 
 static int
@@ -299,14 +297,14 @@ config_do_commit(struct config *c, int type)
   DBG("filter_commit\n");
   filter_commit(c, old_config);
   DBG("sysdep_commit\n");
-  int force_restart = sysdep_commit(c, old_config);
+  sysdep_commit(c, old_config);
   DBG("global_commit\n");
-  force_restart |= global_commit(c, old_config);
+  global_commit(c, old_config);
   mpls_commit(c, old_config);
   DBG("rt_commit\n");
   rt_commit(c, old_config);
   DBG("protos_commit\n");
-  protos_commit(c, old_config, force_restart, type);
+  protos_commit(c, old_config, type);
   int obs = old_config ?
     atomic_fetch_sub_explicit(&old_config->obstacle_count, 1, memory_order_acq_rel) - 1
     : 0;
index f4f8942e4099b01ff2aee6bacbcb9248fdf125ce..a4ce225f40175025f4fede19ecde5fa440d2dcf2 100644 (file)
@@ -281,7 +281,7 @@ int cf_parse(void);
 /* Sysdep hooks */
 
 void sysdep_preconfig(struct config *);
-int sysdep_commit(struct config *, struct config *);
+void sysdep_commit(struct config *, struct config *);
 void sysdep_shutdown_done(void);
 
 #endif
index 47ce10d82b0db15184c6ed3123907116aa3e3cff..696e098c168893873ce2d8f34467de60b594c3bf 100644 (file)
@@ -1456,20 +1456,17 @@ static struct protos_commit_request {
   struct config *new;
   struct config *old;
   enum protocol_startup phase;
-  int force_reconfig;
   int type;
 } protos_commit_request;
 
 static int proto_rethink_goal_pending = 0;
 
-static void protos_do_commit(struct config *new, struct config *old, int force_reconfig, int type);
+static void protos_do_commit(struct config *new, struct config *old, int type);
 
 /**
  * protos_commit - commit new protocol configuration
  * @new: new configuration
  * @old: old configuration or %NULL if it's boot time config
- * @force_reconfig: force restart of all protocols (used for example
- * when the router ID changes)
  * @type: type of reconfiguration (RECONFIG_SOFT or RECONFIG_HARD)
  *
  * Scan differences between @old and @new configuration and adjust all
@@ -1493,21 +1490,20 @@ static void protos_do_commit(struct config *new, struct config *old, int force_r
  * configuration after the shutdown is completed.
  */
 void
-protos_commit(struct config *new, struct config *old, int force_reconfig, int type)
+protos_commit(struct config *new, struct config *old, int type)
 {
   protos_commit_request = (struct protos_commit_request) {
     .new = new,
     .old = old,
     .phase = (new->shutdown && !new->gr_down) ? PROTOCOL_STARTUP_REGULAR : PROTOCOL_STARTUP_NECESSARY,
-    .force_reconfig = force_reconfig,
     .type = type,
   };
 
-  protos_do_commit(new, old, force_reconfig, type);
+  protos_do_commit(new, old, type);
 }
 
 static void
-protos_do_commit(struct config *new, struct config *old, int force_reconfig, int type)
+protos_do_commit(struct config *new, struct config *old, int type)
 {
   enum protocol_startup phase = protos_commit_request.phase;
   struct proto_config *oc, *nc;
@@ -1558,7 +1554,7 @@ protos_do_commit(struct config *new, struct config *old, int force_reconfig, int
        nc->proto = p;
 
        /* We will try to reconfigure protocol p */
-       if (!force_reconfig && proto_reconfigure(p, oc, nc, type))
+       if (proto_reconfigure(p, oc, nc, type))
        {
          PROTO_LEAVE_FROM_MAIN(proto_loop);
          continue;
@@ -1643,7 +1639,7 @@ protos_do_commit(struct config *new, struct config *old, int force_reconfig, int
 
   /* If something is pending, the next round will be called asynchronously from proto_rethink_goal(). */
   if (!proto_rethink_goal_pending)
-    protos_do_commit(new, old, force_reconfig, type);
+    protos_do_commit(new, old, type);
 }
 
 static void
@@ -1701,7 +1697,6 @@ done:
     protos_do_commit(
        protos_commit_request.new,
        protos_commit_request.old,
-       protos_commit_request.force_reconfig,
        protos_commit_request.type
        );
 }
index ed36f418788daee98536103bf74ff18053932bef..9d2e629287767a6cd306d40963d1d7a1f3665a03 100644 (file)
@@ -76,7 +76,7 @@ struct protocol {
 void protos_build(void);               /* Called from sysdep to initialize protocols */
 void proto_build(struct protocol *);   /* Called from protocol to register itself */
 void protos_preconfig(struct config *);
-void protos_commit(struct config *new, struct config *old, int force_restart, int type);
+void protos_commit(struct config *new, struct config *old, int type);
 struct proto * proto_spawn(struct proto_config *cf, uint disabled);
 void protos_dump_all(void);
 
index f9ffbd01536626e0a4826c111b80ac6c5d40db9e..f17996751c3bf0233bcc3d0645ebaf2c3c5d9885 100644 (file)
@@ -200,14 +200,13 @@ sysdep_preconfig(struct config *c)
 #endif
 }
 
-int
+void
 sysdep_commit(struct config *new, struct config *old)
 {
   if (!new->shutdown)
     log_switch(0, &new->logfiles, new->syslog_name);
 
   bird_thread_commit(new, old);
-  return 0;
 }
 
 static int
index cdca38294e58590cbee7fd5093c230c1a8062ff4..76bae76d54e9227faf582d99ea8426f309e8cc77 100644 (file)
@@ -559,10 +559,9 @@ void cmd_reconfig_undo_notify(void) {}
 void sysdep_preconfig(struct config *c UNUSED) {}
 
 void bird_thread_commit(struct config *new, struct config *old);
-int sysdep_commit(struct config *new, struct config *old)
+void sysdep_commit(struct config *new, struct config *old)
 {
   bird_thread_commit(new, old);
-  return 0;
 }
 
 void sysdep_shutdown_done(void) {}