Mitchell Krome([email protected]) on 2019.03.23 20:27:17 +1000:
> Was messing around with ospf and got myself into a situation where the
> router ID's were the same on two boxes because I only did a reload on
> one of them when I changed the loopback IP's.
Thats sub optimal i believe...
> This adds a warning when reloading if the router ID changes (there was
> already a comment saying as much). Same patch can probably be applied to
> ospf6d if people think it's useful.
I think it would be better to abort the reload if the router-id is changed,
i.e. not load the new config at all.
You just add a warning, but who reads the log at that point?
ospf6d cant reload its config at this time, so not a problem there.
/Benno
> Mitchell
>
>
> diff --git a/usr.sbin/ospfd/ospfd.c b/usr.sbin/ospfd/ospfd.c
> index d01a2fa66..db59fc718 100644
> --- a/usr.sbin/ospfd/ospfd.c
> +++ b/usr.sbin/ospfd/ospfd.c
> @@ -694,6 +694,10 @@ merge_config(struct ospfd_conf *conf, struct
> ospfd_conf *xconf)
> int rchange = 0;
>
> /* change of rtr_id needs a restart */
> + if (conf->rtr_id.s_addr != xconf->rtr_id.s_addr &&
> + ospfd_process == PROC_MAIN)
> + log_warnx("Router-ID changed in new configuration. This will "
> + "not apply until ospfd is restarted.");
> conf->flags = xconf->flags;
> conf->spf_delay = xconf->spf_delay;
> conf->spf_hold_time = xconf->spf_hold_time;
>