]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Nest: Add channel config flag to distinguish new or copy
authorOndrej Zajicek <santiago@crfreenet.org>
Mon, 3 Oct 2022 16:53:21 +0000 (18:53 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Mon, 3 Oct 2022 18:18:12 +0000 (20:18 +0200)
It is useful to distinguish whehter channel config returned from
channel_config_get() was allocated new, or existing from template.
Caller may want to initialize new ones.

nest/proto.c
nest/protocol.h

index 60a749643f932b1a32837647e3d7ff1bc61e732e..885a0b7523fa1017001e8abd4cd125c816a04bfd 100644 (file)
@@ -804,6 +804,7 @@ channel_config_get(const struct channel_class *cc, const char *name, uint net_ty
        cf_error("Multiple %s channels", name);
 
       cf->parent = proto;
+      cf->copy = 1;
       return cf;
     }
 
index 29d759ea3083beb5c04261639b070438b5ac6420..46744357eb2cdd989cc7c15a6979d6173e3b90eb 100644 (file)
@@ -493,6 +493,7 @@ struct channel_config {
   u8 ra_mode;                          /* Mode of received route advertisements (RA_*) */
   u16 preference;                      /* Default route preference */
   u32 debug;                           /* Debugging flags (D_*) */
+  u8 copy;                             /* Value from channel_config_get() is new (0) or from template (1) */
   u8 merge_limit;                      /* Maximal number of nexthops for RA_MERGED */
   u8 in_keep_filtered;                 /* Routes rejected in import filter are kept */
   u8 rpki_reload;                      /* RPKI changes trigger channel reload */