summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2021-03-16 20:10:00 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2021-03-16 20:10:00 +0100
commit2f981534902302cbd13cdb12d4f0c6e9a255687a (patch)
treec48754a98a591484e9d7a16ca05d3d287076b58c /proto
parentae9ae864d3fec20a74ce2567536e186ce178d032 (diff)
Pipe: Propagate debug flags from protocol to channels
Pipe channels are kind-of implicit, so setting protocol debug flags should also set pipe debug flags.
Diffstat (limited to 'proto')
-rw-r--r--proto/pipe/pipe.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/proto/pipe/pipe.c b/proto/pipe/pipe.c
index 7b5de324..3532f114 100644
--- a/proto/pipe/pipe.c
+++ b/proto/pipe/pipe.c
@@ -141,6 +141,8 @@ pipe_postconfig(struct proto_config *CF)
if (cc->in_keep_filtered)
cf_error("Pipe protocol prohibits keeping filtered routes");
+
+ cc->debug = cf->c.debug;
}
static int
@@ -155,6 +157,7 @@ pipe_configure_channels(struct pipe_proto *p, struct pipe_config *cf)
.out_filter = cc->out_filter,
.in_limit = cc->in_limit,
.ra_mode = RA_ANY,
+ .debug = cc->debug,
.rpki_reload = cc->rpki_reload,
};
@@ -165,6 +168,7 @@ pipe_configure_channels(struct pipe_proto *p, struct pipe_config *cf)
.out_filter = cc->in_filter,
.in_limit = cc->out_limit,
.ra_mode = RA_ANY,
+ .debug = cc->debug,
.rpki_reload = cc->rpki_reload,
};
@@ -278,6 +282,14 @@ pipe_show_proto_info(struct proto *P)
pipe_show_stats(p);
}
+void
+pipe_update_debug(struct proto *P)
+{
+ struct pipe_proto *p = (void *) P;
+
+ p->pri->debug = p->sec->debug = p->p.debug;
+}
+
struct protocol proto_pipe = {
.name = "Pipe",