On Fri, Mar 22, 2019 at 04:47:46PM +0100, Denis Fondras wrote:
> ROV has been broken since the configuration reload changes.
I don't like this. The goal is to not use memcpy for struct bgpd_config
because of all the pointer it holds. It feels like a field is missing in
copy_config(). Will look into this later.
> Index: rde.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpd/rde.c,v
> retrieving revision 1.466
> diff -u -p -r1.466 rde.c
> --- rde.c 13 Mar 2019 14:35:39 -0000 1.466
> +++ rde.c 22 Mar 2019 15:36:41 -0000
> @@ -769,7 +769,7 @@ rde_dispatch_imsg_parent(struct imsgbuf
> fatal(NULL);
> SIMPLEQ_INIT(newdomains);
> nconf = new_config();
> - copy_config(nconf, imsg.data);
> + memcpy(nconf, imsg.data, sizeof(struct bgpd_config));
>
> for (rid = 0; rid < rib_size; rid++) {
> if (!rib_valid(rid))
> @@ -2899,7 +2899,7 @@ rde_reload_done(void)
> roa_old = conf->rde_roa;
> as_sets_old = conf->as_sets;
>
> - copy_config(conf, nconf);
> + memcpy(conf, nconf, sizeof(struct bgpd_config));
> SIMPLEQ_INIT(&conf->rde_prefixsets);
> SIMPLEQ_INIT(&conf->rde_originsets);
> SIMPLEQ_CONCAT(&conf->rde_prefixsets, &nconf->rde_prefixsets);
>
--
:wq Claudio