summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pimd/pim_ifchannel.c4
-rw-r--r--pimd/pim_upstream.c5
-rw-r--r--pimd/pim_upstream.h1
3 files changed, 10 insertions, 0 deletions
diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c
index 5afb8e7737..ab01c7f13e 100644
--- a/pimd/pim_ifchannel.c
+++ b/pimd/pim_ifchannel.c
@@ -175,6 +175,8 @@ void pim_ifchannel_delete(struct pim_ifchannel *ch)
if (ch->sources)
list_delete (ch->sources);
+ listnode_delete(ch->upstream->ifchannels, ch);
+
if (ch->ifjoin_state != PIM_IFJOIN_NOINFO) {
pim_upstream_update_join_desired(ch->upstream);
}
@@ -569,6 +571,8 @@ pim_ifchannel_add(struct interface *ifp,
ch = hash_get (pim_ifp->pim_ifchannel_hash, ch, hash_alloc_intern);
listnode_add_sort(pim_ifchannel_list, ch);
+ listnode_add_sort(up->ifchannels, ch);
+
return ch;
}
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c
index b9db75f148..5f98348c3e 100644
--- a/pimd/pim_upstream.c
+++ b/pimd/pim_upstream.c
@@ -214,6 +214,8 @@ pim_upstream_del(struct pim_upstream *up, const char *name)
}
up->sources = NULL;
+ list_delete (up->ifchannels);
+
/*
notice that listnode_delete() can't be moved
into pim_upstream_free() because the later is
@@ -673,6 +675,9 @@ pim_upstream_new (struct prefix_sg *sg,
up->rpf.rpf_addr.family = AF_INET;
up->rpf.rpf_addr.u.prefix4.s_addr = PIM_NET_INADDR_ANY;
+ up->ifchannels = list_new();
+ up->ifchannels->cmp = (int (*)(void *, void *))pim_ifchannel_compare;
+
if (up->sg.src.s_addr != INADDR_ANY)
wheel_add_item (pim_upstream_sg_wheel, up);
diff --git a/pimd/pim_upstream.h b/pimd/pim_upstream.h
index e74ee37a12..f1c8df35b1 100644
--- a/pimd/pim_upstream.h
+++ b/pimd/pim_upstream.h
@@ -100,6 +100,7 @@ struct pim_upstream {
uint32_t flags;
struct channel_oil *channel_oil;
struct list *sources;
+ struct list *ifchannels;
enum pim_upstream_state join_state;
enum pim_reg_state reg_state;