From 8478de8817c58af02f7aed1d621013891115a2dc Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 3 Oct 2022 18:53:21 +0200 Subject: Nest: Add channel config flag to distinguish new or copy 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 | 1 + nest/protocol.h | 1 + 2 files changed, 2 insertions(+) (limited to 'nest') diff --git a/nest/proto.c b/nest/proto.c index 60a74964..885a0b75 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -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; } diff --git a/nest/protocol.h b/nest/protocol.h index 29d759ea..46744357 100644 --- a/nest/protocol.h +++ b/nest/protocol.h @@ -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 */ -- cgit v1.2.3