summaryrefslogtreecommitdiff
path: root/proto/pipe
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2015-02-21 21:08:23 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2015-02-21 21:08:23 +0100
commit2bbc308321894e0fd301766e8d7d78a4ec119053 (patch)
treecd3b8bab72022801655ad6b420ace93267b29f07 /proto/pipe
parent374917adccb955fbb2796955166fabe46a09e096 (diff)
Store protocol config size inside protocol structure
Make proto_config_new() use this info instead of supplied size. Thanks to Alexander V. Chernikov for the patch.
Diffstat (limited to 'proto/pipe')
-rw-r--r--proto/pipe/config.Y2
-rw-r--r--proto/pipe/pipe.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/proto/pipe/config.Y b/proto/pipe/config.Y
index 40637558..8daf2e7c 100644
--- a/proto/pipe/config.Y
+++ b/proto/pipe/config.Y
@@ -23,7 +23,7 @@ CF_GRAMMAR
CF_ADDTO(proto, pipe_proto '}')
pipe_proto_start: proto_start PIPE {
- this_proto = proto_config_new(&proto_pipe, sizeof(struct pipe_config), $1);
+ this_proto = proto_config_new(&proto_pipe, $1);
PIPE_CFG->mode = PIPE_TRANSPARENT;
}
;
diff --git a/proto/pipe/pipe.c b/proto/pipe/pipe.c
index d6ef153a..6ef80322 100644
--- a/proto/pipe/pipe.c
+++ b/proto/pipe/pipe.c
@@ -247,7 +247,7 @@ pipe_reconfigure(struct proto *P, struct proto_config *new)
if ((P->proto_state != PS_UP) || (proto_reconfig_type == RECONFIG_SOFT))
return 1;
-
+
if ((new->preference != old->preference)
|| ! filter_same(new->in_filter, old->in_filter)
|| ! filter_same(new->out_filter, old->out_filter))
@@ -298,7 +298,7 @@ pipe_show_stats(struct pipe_proto *p)
* (imp/exp), while stats s2 have switched 'polarity'.
*/
- cli_msg(-1006, " Routes: %u imported, %u exported",
+ cli_msg(-1006, " Routes: %u imported, %u exported",
s1->imp_routes, s2->imp_routes);
cli_msg(-1006, " Route change stats: received rejected filtered ignored accepted");
cli_msg(-1006, " Import updates: %10u %10u %10u %10u %10u",
@@ -340,6 +340,7 @@ struct protocol proto_pipe = {
.template = "pipe%d",
.multitable = 1,
.preference = DEF_PREF_PIPE,
+ .config_size = sizeof(struct pipe_config),
.postconfig = pipe_postconfig,
.init = pipe_init,
.start = pipe_start,