}
if (old_config) /* Reconfiguration already in progress */
{
- if (shutting_down)
+ if (shutting_down == 2)
{
log(L_INFO "New configuration discarded due to shutdown");
config_free(c);
init_list(&c->protos);
init_list(&c->tables);
c->shutdown = 1;
- config_commit(c);
shutting_down = 1;
+ config_commit(c);
+ shutting_down = 2;
}
/**
nl_add_attr_ipa(&r.h, sizeof(r), RTA_GATEWAY, a->gw);
break;
case RTD_DEVICE:
+ if (!a->iface)
+ return;
r.r.rtm_type = RTN_UNICAST;
nl_add_attr_u32(&r.h, sizeof(r), RTA_OIF, a->iface->index);
break;
else
{
if (old)
- {
- if (!old->attrs->iface || (old->attrs->iface->flags & IF_UP))
- nl_send_route(p, old, 0);
- /* else the kernel has already flushed it */
- }
+ nl_send_route(p, old, 0);
+
if (new)
nl_send_route(p, new, 1);
}
{
struct krt_proto *p = (struct krt_proto *) P;
- if (shutting_down && KRT_CF->persist)
+ if (shutting_down)
return;
if (new && (!krt_capable(new) || new->attrs->source == RTS_INHERIT))
new = NULL;