mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-03-23 14:57:02 +00:00
fixup! fixup! partial reload for RPKI - not working
This commit is contained in:
parent
292af59e06
commit
eae05c1346
@ -1565,7 +1565,6 @@ bgp_reload_routes(struct channel *C, struct channel_import_request *cir)
|
|||||||
{
|
{
|
||||||
struct bgp_proto *p = (void *) C->proto;
|
struct bgp_proto *p = (void *) C->proto;
|
||||||
struct bgp_channel *c = (void *) C;
|
struct bgp_channel *c = (void *) C;
|
||||||
log("in bgp");
|
|
||||||
|
|
||||||
/* Ignore non-BGP channels */
|
/* Ignore non-BGP channels */
|
||||||
if (C->class != &channel_bgp)
|
if (C->class != &channel_bgp)
|
||||||
|
@ -438,10 +438,15 @@ ospf_reload_routes(struct channel *C, struct channel_import_request *cir)
|
|||||||
struct ospf_proto *p = (struct ospf_proto *) C->proto;
|
struct ospf_proto *p = (struct ospf_proto *) C->proto;
|
||||||
|
|
||||||
if (cir) {
|
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;
|
cir->next = p->cir;
|
||||||
p->cir = cir;
|
p->cir = cir;
|
||||||
pthread_mutex_unlock(&p->mutex);
|
DG_UNLOCK(p->lock);
|
||||||
}
|
}
|
||||||
if (p->calcrt == 2)
|
if (p->calcrt == 2)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
#ifndef _BIRD_OSPF_H_
|
#ifndef _BIRD_OSPF_H_
|
||||||
#define _BIRD_OSPF_H_
|
#define _BIRD_OSPF_H_
|
||||||
|
|
||||||
#include <pthread.h>
|
|
||||||
#include "nest/bird.h"
|
#include "nest/bird.h"
|
||||||
|
|
||||||
#include "lib/checksum.h"
|
#include "lib/checksum.h"
|
||||||
@ -221,7 +220,7 @@ struct ospf_proto
|
|||||||
int calcrt; /* Routing table calculation scheduled?
|
int calcrt; /* Routing table calculation scheduled?
|
||||||
0=no, 1=normal, 2=forced reload */
|
0=no, 1=normal, 2=forced reload */
|
||||||
struct channel_import_request *cir; /* Struct with trie for partial 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 iface_list; /* List of OSPF interfaces (struct ospf_iface) */
|
||||||
list area_list; /* List of OSPF areas (struct ospf_area) */
|
list area_list; /* List of OSPF areas (struct ospf_area) */
|
||||||
int areano; /* Number of area I belong to */
|
int areano; /* Number of area I belong to */
|
||||||
|
@ -2019,10 +2019,10 @@ rt_sync(struct ospf_proto *p)
|
|||||||
|
|
||||||
OSPF_TRACE(D_EVENTS, "Starting routing table synchronization");
|
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;
|
struct channel_import_request *cir = p->cir;
|
||||||
p->cir = NULL;
|
p->cir = NULL;
|
||||||
pthread_mutex_unlock(&p->mutex);
|
DG_UNLOCK(attr, p->lock);
|
||||||
|
|
||||||
DBG("Now syncing my rt table with nest's\n");
|
DBG("Now syncing my rt table with nest's\n");
|
||||||
FIB_ITERATE_INIT(&fit, fib);
|
FIB_ITERATE_INIT(&fit, fib);
|
||||||
|
@ -968,10 +968,10 @@ rip_timer(timer *t)
|
|||||||
|
|
||||||
FIB_ITERATE_INIT(&fit, &p->rtable);
|
FIB_ITERATE_INIT(&fit, &p->rtable);
|
||||||
|
|
||||||
pthread_mutex_lock(&p->mutex);
|
DG_LOCK(attrs, p->lock);
|
||||||
struct channel_import_request *cir = p->cir;
|
struct channel_import_request *cir = p->cir;
|
||||||
p->cir = NULL;
|
p->cir = NULL;
|
||||||
pthread_mutex_unlock(&p->mutex);
|
DG_UNLOCK(attrs, p->lock);
|
||||||
|
|
||||||
loop:
|
loop:
|
||||||
FIB_ITERATE_START(&p->rtable, &fit, struct rip_entry, en)
|
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;
|
struct rip_proto *p = (struct rip_proto *) C->proto;
|
||||||
|
|
||||||
if (cir) {
|
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;
|
cir->next = p->cir;
|
||||||
p->cir = cir;
|
p->cir = cir;
|
||||||
pthread_mutex_lock(&p->mutex);
|
DG_UNLOCK(p->lock);
|
||||||
}
|
}
|
||||||
if (p->rt_reload)
|
if (p->rt_reload)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
#ifndef _BIRD_RIP_H_
|
#ifndef _BIRD_RIP_H_
|
||||||
#define _BIRD_RIP_H_
|
#define _BIRD_RIP_H_
|
||||||
|
|
||||||
#include <pthread.h>
|
|
||||||
#include "nest/bird.h"
|
#include "nest/bird.h"
|
||||||
#include "nest/cli.h"
|
#include "nest/cli.h"
|
||||||
#include "nest/iface.h"
|
#include "nest/iface.h"
|
||||||
@ -105,7 +104,7 @@ struct rip_proto
|
|||||||
struct tbf log_pkt_tbf; /* TBF for packet messages */
|
struct tbf log_pkt_tbf; /* TBF for packet messages */
|
||||||
struct tbf log_rte_tbf; /* TBF for RTE messages */
|
struct tbf log_rte_tbf; /* TBF for RTE messages */
|
||||||
struct channel_import_request *cir; /* Trie for partial reload */
|
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
|
struct rip_iface
|
||||||
|
Loading…
x
Reference in New Issue
Block a user