mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-03 15:41:54 +00:00
Remove duplicate code in proto/stats/stats.c
This commit is contained in:
parent
9661370e80
commit
fe196ec397
@ -88,17 +88,6 @@ stats_init(struct proto_config *CF)
|
|||||||
return P;
|
return P;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct channel *
|
|
||||||
stats_find_channel(struct stats_proto *p, const char *name)
|
|
||||||
{
|
|
||||||
struct channel *c;
|
|
||||||
WALK_LIST(c, p->p.channels)
|
|
||||||
if (strcmp(c->name, name))
|
|
||||||
return c;
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
stats_start(struct proto *P UNUSED)
|
stats_start(struct proto *P UNUSED)
|
||||||
{
|
{
|
||||||
@ -118,7 +107,7 @@ stats_reconfigure(struct proto *P, struct proto_config *CF)
|
|||||||
struct channel_config *cc;
|
struct channel_config *cc;
|
||||||
WALK_LIST(cc, new->c.channels)
|
WALK_LIST(cc, new->c.channels)
|
||||||
{
|
{
|
||||||
c = (struct channel *) stats_find_channel(p, cc->name);
|
c = proto_find_channel_by_name(P, cc->name);
|
||||||
if (!proto_configure_channel(P, &c, cc))
|
if (!proto_configure_channel(P, &c, cc))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user