]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Nest: Forbid adding channels during reconfiguration
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 11 Dec 2018 16:57:14 +0000 (17:57 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 11 Dec 2018 16:57:14 +0000 (17:57 +0100)
When a new channel is found during reconfiguration, do force restart
of the protocol, like with any other un-reconfigurable change.

The old behavior was that the new channel was added but remained in down
state, even if the protocol was up, so a manual protocol restart was
often necessary.

In the future this should be improved such that a reconfigurable
channel addition (e.g. direct) is accepted and channel is started,
while an un-reconfigurable addition forces protocol restart.

nest/proto.c
proto/bgp/bgp.c

index 3dcb3429220fb5c95c80a6f1ba071b610d763fcc..a6aa4e5cefda29c8697e747b3e253623c4a93174 100644 (file)
@@ -602,7 +602,11 @@ proto_configure_channel(struct proto *p, struct channel **pc, struct channel_con
 
   if (!c && cf)
   {
-    *pc = proto_add_channel(p, cf);
+    /* We could add the channel, but currently it would just stay in down state
+       until protocol is restarted, so it is better to force restart anyways. */
+    log(L_INFO "Cannot add channel %s.%s", p->name, cf->name);
+    return 0;
+    // *pc = proto_add_channel(p, cf);
   }
   else if (c && !cf)
   {
index 496393ab05969e19f9ac95441aae6acfba99be1a..e20097ae901e96daf2c1f43eab616d617325554d 100644 (file)
@@ -1878,7 +1878,9 @@ bgp_reconfigure(struct proto *P, struct proto_config *CF)
   {
     C = (struct channel *) bgp_find_channel(p, cc->afi);
     same = proto_configure_channel(P, &C, &cc->c) && same;
-    C->stale = 0;
+
+    if (C)
+      C->stale = 0;
   }
 
   WALK_LIST_DELSAFE(C, C2, p->p.channels)