Claudio Jeker([email protected]) on 2020.01.09 16:05:06 +0100:
> When using 'export default-route' you still need an output filter to allow
> the default route out. I'm probably not the only one forgetting this fact
> from time to time. Now to make things worse adding the filter rule to
> allow the route plus config reload does not work since the softreconfigure
> code does not handle the export default-route case correctly.
ok
> The following diff fixes this. There is still the problem that changing
> the 'export default-route' setting itself needs a session reset but that
> one is less easy to tackle :(
>
> --
> :wq Claudio
>
> Index: rde.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpd/rde.c,v
> retrieving revision 1.498
> diff -u -p -r1.498 rde.c
> --- rde.c 9 Jan 2020 13:31:52 -0000 1.498
> +++ rde.c 9 Jan 2020 14:42:37 -0000
> @@ -3221,11 +3221,25 @@ rde_softreconfig_in_done(void *arg, u_in
> }
>
> LIST_FOREACH(peer, &peerlist, peer_l) {
> - if (peer->reconf_out)
> - rib_byid(peer->loc_rib_id)->state = RECONF_RELOAD;
> - else if (peer->reconf_rib) {
> - u_int8_t aid;
> + u_int8_t aid;
>
> + if (peer->reconf_out) {
> + if (peer->conf.export_type == EXPORT_NONE) {
> + /* nothing to do here */
> + peer->reconf_out = 0;
> + } else if (peer->conf.export_type ==
> + EXPORT_DEFAULT_ROUTE) {
> + /* just resend the default route */
> + for (aid = 0; aid < AID_MAX; aid++) {
> + if (peer->capa.mp[aid])
> + up_generate_default(out_rules,
> + peer, aid);
> + }
> + peer->reconf_out = 0;
> + } else
> + rib_byid(peer->loc_rib_id)->state =
> + RECONF_RELOAD;
> + } else if (peer->reconf_rib) {
> /* dump the full table to neighbors that changed rib */
> for (aid = 0; aid < AID_MAX; aid++) {
> if (peer->capa.mp[aid])
>