0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00

fixup! fixup! partial reload for RPKI - not working

This commit is contained in:
Katerina Kubecova 2023-10-24 14:39:40 +02:00
parent 292af59e06
commit eae05c1346
6 changed files with 20 additions and 13 deletions

View File

@ -1565,7 +1565,6 @@ bgp_reload_routes(struct channel *C, struct channel_import_request *cir)
{
struct bgp_proto *p = (void *) C->proto;
struct bgp_channel *c = (void *) C;
log("in bgp");
/* Ignore non-BGP channels */
if (C->class != &channel_bgp)

View File

@ -438,10 +438,15 @@ ospf_reload_routes(struct channel *C, struct channel_import_request *cir)
struct ospf_proto *p = (struct ospf_proto *) C->proto;
if (cir) {
pthread_mutex_lock(&p->mutex);
if (p->lock == NULL)
{
p->lock = DOMAIN_NEW(attrs);
DOMAIN_SETUP(attrs, p->lock, "Partial request lock ospf", NULL);
}
DG_LOCK(p->lock);
cir->next = p->cir;
p->cir = cir;
pthread_mutex_unlock(&p->mutex);
DG_UNLOCK(p->lock);
}
if (p->calcrt == 2)
return 1;

View File

@ -11,7 +11,6 @@
#ifndef _BIRD_OSPF_H_
#define _BIRD_OSPF_H_
#include <pthread.h>
#include "nest/bird.h"
#include "lib/checksum.h"
@ -221,7 +220,7 @@ struct ospf_proto
int calcrt; /* Routing table calculation scheduled?
0=no, 1=normal, 2=forced reload */
struct channel_import_request *cir; /* Struct with trie for partial reload */
pthread_mutex_t mutex; /* Mutex for partial reload */
DOMAIN(attrs) lock; /*nebo struct domain_generic *? *//* Lock for partial reload */
list iface_list; /* List of OSPF interfaces (struct ospf_iface) */
list area_list; /* List of OSPF areas (struct ospf_area) */
int areano; /* Number of area I belong to */

View File

@ -2019,10 +2019,10 @@ rt_sync(struct ospf_proto *p)
OSPF_TRACE(D_EVENTS, "Starting routing table synchronization");
pthread_mutex_lock(&p->mutex);
DG_LOCK(attr, p->lock);
struct channel_import_request *cir = p->cir;
p->cir = NULL;
pthread_mutex_unlock(&p->mutex);
DG_UNLOCK(attr, p->lock);
DBG("Now syncing my rt table with nest's\n");
FIB_ITERATE_INIT(&fit, fib);

View File

@ -968,10 +968,10 @@ rip_timer(timer *t)
FIB_ITERATE_INIT(&fit, &p->rtable);
pthread_mutex_lock(&p->mutex);
DG_LOCK(attrs, p->lock);
struct channel_import_request *cir = p->cir;
p->cir = NULL;
pthread_mutex_unlock(&p->mutex);
DG_UNLOCK(attrs, p->lock);
loop:
FIB_ITERATE_START(&p->rtable, &fit, struct rip_entry, en)
@ -1163,10 +1163,15 @@ rip_reload_routes(struct channel *C, struct channel_import_request *cir)
struct rip_proto *p = (struct rip_proto *) C->proto;
if (cir) {
pthread_mutex_lock(&p->mutex);
if (p->lock==NULL)
{
p->lock = DOMAIN_NEW(attrs);
DOMAIN_SETUP(attrs, p->lock, "Partial request lock rip", NULL);
}
DG_LOCK(p->lock);
cir->next = p->cir;
p->cir = cir;
pthread_mutex_lock(&p->mutex);
DG_UNLOCK(p->lock);
}
if (p->rt_reload)
return 1;

View File

@ -12,7 +12,6 @@
#ifndef _BIRD_RIP_H_
#define _BIRD_RIP_H_
#include <pthread.h>
#include "nest/bird.h"
#include "nest/cli.h"
#include "nest/iface.h"
@ -105,7 +104,7 @@ struct rip_proto
struct tbf log_pkt_tbf; /* TBF for packet messages */
struct tbf log_rte_tbf; /* TBF for RTE messages */
struct channel_import_request *cir; /* Trie for partial reload */
pthread_mutex_t mutex; /* Mutex for partial reload */
DOMAIN(attrs) lock; /* Lock for partial reload */
};
struct rip_iface