Commit 061ffdbe authored by Igor Putovny's avatar Igor Putovny
Browse files

Pipe can now merge routes

parent 75257cf7
Pipeline #106884 passed with stages
in 33 minutes and 2 seconds
Subproject commit 5cdb8273ea3e06cb8487125d572c9b87c121f975
Subproject commit fb510fc9d33a3220ffa9e139782cccb641d38b1a
......@@ -41,6 +41,7 @@ pipe_proto:
| pipe_proto proto_item ';'
| pipe_proto channel_item_ ';'
| pipe_proto PEER TABLE rtable ';' { PIPE_CFG->peer = $4; }
| pipe_proto MERGE PATHS bool kern_mp_limit { PIPE_CFG->merge_limit = $4 ? $5 : 0; }
;
CF_CODE
......
......@@ -92,7 +92,7 @@ pipe_rt_notify(struct proto *P, struct channel *src_ch, net *n, rte *new, rte *o
}
src_ch->table->pipe_busy = 1;
rte_update2(dst, n->n.addr, e, src);
rte_update2(dst, n->n.addr, e, old ? old->src : new->src);
src_ch->table->pipe_busy = 0;
}
......@@ -155,7 +155,8 @@ pipe_configure_channels(struct pipe_proto *p, struct pipe_config *cf)
.table = cc->table,
.out_filter = cc->out_filter,
.in_limit = cc->in_limit,
.ra_mode = RA_ANY,
.ra_mode = cf->merge_limit ? RA_MERGED : RA_ANY,
.merge_limit = cf->merge_limit,
.debug = cc->debug,
.rpki_reload = cc->rpki_reload,
};
......@@ -166,7 +167,8 @@ pipe_configure_channels(struct pipe_proto *p, struct pipe_config *cf)
.table = cf->peer,
.out_filter = cc->in_filter,
.in_limit = cc->out_limit,
.ra_mode = RA_ANY,
.ra_mode = cf->merge_limit ? RA_MERGED : RA_ANY,
.merge_limit = cf->merge_limit,
.debug = cc->debug,
.rpki_reload = cc->rpki_reload,
};
......
......@@ -12,6 +12,7 @@
struct pipe_config {
struct proto_config c;
struct rtable_config *peer; /* Table we're connected to */
u8 merge_limit;
};
struct pipe_proto {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment