mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 02:02:18 +00:00
pimd: Cleanup pimg from pim_upstream.c
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
71edad0fd5
commit
8e5f97e3c1
@ -377,7 +377,7 @@ int pim_register_recv(struct interface *ifp, struct in_addr dest_addr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((upstream->sptbit == PIM_UPSTREAM_SPTBIT_TRUE)
|
if ((upstream->sptbit == PIM_UPSTREAM_SPTBIT_TRUE)
|
||||||
|| ((SwitchToSptDesired(&sg))
|
|| ((SwitchToSptDesired(pim_ifp->pim, &sg))
|
||||||
&& pim_upstream_inherited_olist(pim_ifp->pim, upstream)
|
&& pim_upstream_inherited_olist(pim_ifp->pim, upstream)
|
||||||
== 0)) {
|
== 0)) {
|
||||||
// pim_scan_individual_oil (upstream->channel_oil);
|
// pim_scan_individual_oil (upstream->channel_oil);
|
||||||
@ -389,7 +389,7 @@ int pim_register_recv(struct interface *ifp, struct in_addr dest_addr,
|
|||||||
upstream->sptbit);
|
upstream->sptbit);
|
||||||
}
|
}
|
||||||
if ((upstream->sptbit == PIM_UPSTREAM_SPTBIT_TRUE)
|
if ((upstream->sptbit == PIM_UPSTREAM_SPTBIT_TRUE)
|
||||||
|| (SwitchToSptDesired(&sg))) {
|
|| (SwitchToSptDesired(pim_ifp->pim, &sg))) {
|
||||||
if (sentRegisterStop) {
|
if (sentRegisterStop) {
|
||||||
pim_upstream_keep_alive_timer_start(
|
pim_upstream_keep_alive_timer_start(
|
||||||
upstream, qpim_rp_keep_alive_time);
|
upstream, qpim_rp_keep_alive_time);
|
||||||
|
@ -1081,10 +1081,12 @@ static void pim_upstream_fhr_kat_start(struct pim_upstream *up)
|
|||||||
static int pim_upstream_keep_alive_timer(struct thread *t)
|
static int pim_upstream_keep_alive_timer(struct thread *t)
|
||||||
{
|
{
|
||||||
struct pim_upstream *up;
|
struct pim_upstream *up;
|
||||||
|
struct pim_instance *pim;
|
||||||
|
|
||||||
up = THREAD_ARG(t);
|
up = THREAD_ARG(t);
|
||||||
|
pim = up->channel_oil->pim;
|
||||||
|
|
||||||
if (I_am_RP(pimg, up->sg.grp)) {
|
if (I_am_RP(pim, up->sg.grp)) {
|
||||||
pim_br_clear_pmbr(&up->sg);
|
pim_br_clear_pmbr(&up->sg);
|
||||||
/*
|
/*
|
||||||
* We need to do more here :)
|
* We need to do more here :)
|
||||||
@ -1097,15 +1099,15 @@ static int pim_upstream_keep_alive_timer(struct thread *t)
|
|||||||
|
|
||||||
/* if entry was created because of activity we need to deref it */
|
/* if entry was created because of activity we need to deref it */
|
||||||
if (PIM_UPSTREAM_FLAG_TEST_SRC_STREAM(up->flags)) {
|
if (PIM_UPSTREAM_FLAG_TEST_SRC_STREAM(up->flags)) {
|
||||||
pim_upstream_fhr_kat_expiry(pimg, up);
|
pim_upstream_fhr_kat_expiry(pim, up);
|
||||||
if (PIM_DEBUG_TRACE)
|
if (PIM_DEBUG_TRACE)
|
||||||
zlog_debug("kat expired on %s; remove stream reference",
|
zlog_debug("kat expired on %s; remove stream reference",
|
||||||
up->sg_str);
|
up->sg_str);
|
||||||
PIM_UPSTREAM_FLAG_UNSET_SRC_STREAM(up->flags);
|
PIM_UPSTREAM_FLAG_UNSET_SRC_STREAM(up->flags);
|
||||||
pim_upstream_del(pimg, up, __PRETTY_FUNCTION__);
|
pim_upstream_del(pim, up, __PRETTY_FUNCTION__);
|
||||||
} else if (PIM_UPSTREAM_FLAG_TEST_SRC_LHR(up->flags)) {
|
} else if (PIM_UPSTREAM_FLAG_TEST_SRC_LHR(up->flags)) {
|
||||||
PIM_UPSTREAM_FLAG_UNSET_SRC_LHR(up->flags);
|
PIM_UPSTREAM_FLAG_UNSET_SRC_LHR(up->flags);
|
||||||
pim_upstream_del(pimg, up, __PRETTY_FUNCTION__);
|
pim_upstream_del(pim, up, __PRETTY_FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1175,9 +1177,10 @@ void pim_upstream_msdp_reg_timer_start(struct pim_upstream *up)
|
|||||||
* SwitchToSptDesired(S,G) return true once a single packet has been
|
* SwitchToSptDesired(S,G) return true once a single packet has been
|
||||||
* received for the source and group.
|
* received for the source and group.
|
||||||
*/
|
*/
|
||||||
int pim_upstream_switch_to_spt_desired(struct prefix_sg *sg)
|
int pim_upstream_switch_to_spt_desired(struct pim_instance *pim,
|
||||||
|
struct prefix_sg *sg)
|
||||||
{
|
{
|
||||||
if (I_am_RP(pimg, sg->grp))
|
if (I_am_RP(pim, sg->grp))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1311,10 +1314,12 @@ const char *pim_reg_state2str(enum pim_reg_state reg_state, char *state_str)
|
|||||||
static int pim_upstream_register_stop_timer(struct thread *t)
|
static int pim_upstream_register_stop_timer(struct thread *t)
|
||||||
{
|
{
|
||||||
struct pim_interface *pim_ifp;
|
struct pim_interface *pim_ifp;
|
||||||
|
struct pim_instance *pim;
|
||||||
struct pim_upstream *up;
|
struct pim_upstream *up;
|
||||||
struct pim_rpf *rpg;
|
struct pim_rpf *rpg;
|
||||||
struct ip ip_hdr;
|
struct ip ip_hdr;
|
||||||
up = THREAD_ARG(t);
|
up = THREAD_ARG(t);
|
||||||
|
pim = up->channel_oil->pim;
|
||||||
|
|
||||||
if (PIM_DEBUG_TRACE) {
|
if (PIM_DEBUG_TRACE) {
|
||||||
char state_str[PIM_REG_STATE_STR_LEN];
|
char state_str[PIM_REG_STATE_STR_LEN];
|
||||||
@ -1326,7 +1331,7 @@ static int pim_upstream_register_stop_timer(struct thread *t)
|
|||||||
switch (up->reg_state) {
|
switch (up->reg_state) {
|
||||||
case PIM_REG_JOIN_PENDING:
|
case PIM_REG_JOIN_PENDING:
|
||||||
up->reg_state = PIM_REG_JOIN;
|
up->reg_state = PIM_REG_JOIN;
|
||||||
pim_channel_add_oif(up->channel_oil, pimg->regiface,
|
pim_channel_add_oif(up->channel_oil, pim->regiface,
|
||||||
PIM_OIF_FLAG_PROTO_PIM);
|
PIM_OIF_FLAG_PROTO_PIM);
|
||||||
break;
|
break;
|
||||||
case PIM_REG_JOIN:
|
case PIM_REG_JOIN:
|
||||||
@ -1558,6 +1563,8 @@ static int pim_upstream_equal(const void *arg1, const void *arg2)
|
|||||||
*/
|
*/
|
||||||
static bool pim_upstream_kat_start_ok(struct pim_upstream *up)
|
static bool pim_upstream_kat_start_ok(struct pim_upstream *up)
|
||||||
{
|
{
|
||||||
|
struct pim_instance *pim = up->channel_oil->pim;
|
||||||
|
|
||||||
/* "iif == RPF_interface(S)" check has to be done by the kernel or hw
|
/* "iif == RPF_interface(S)" check has to be done by the kernel or hw
|
||||||
* so we will skip that here */
|
* so we will skip that here */
|
||||||
if (pim_if_connected_to_source(up->rpf.source_nexthop.interface,
|
if (pim_if_connected_to_source(up->rpf.source_nexthop.interface,
|
||||||
@ -1577,7 +1584,7 @@ static bool pim_upstream_kat_start_ok(struct pim_upstream *up)
|
|||||||
* MUST be
|
* MUST be
|
||||||
* removed to handle spt turn-arounds correctly in a 3-tier clos
|
* removed to handle spt turn-arounds correctly in a 3-tier clos
|
||||||
*/
|
*/
|
||||||
if (I_am_RP(pimg, up->sg.grp))
|
if (I_am_RP(pim, up->sg.grp))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1591,9 +1598,10 @@ static bool pim_upstream_kat_start_ok(struct pim_upstream *up)
|
|||||||
static void pim_upstream_sg_running(void *arg)
|
static void pim_upstream_sg_running(void *arg)
|
||||||
{
|
{
|
||||||
struct pim_upstream *up = (struct pim_upstream *)arg;
|
struct pim_upstream *up = (struct pim_upstream *)arg;
|
||||||
|
struct pim_instance *pim = up->channel_oil->pim;
|
||||||
|
|
||||||
// No packet can have arrived here if this is the case
|
// No packet can have arrived here if this is the case
|
||||||
if (!up->channel_oil || !up->channel_oil->installed) {
|
if (!up->channel_oil->installed) {
|
||||||
if (PIM_DEBUG_TRACE)
|
if (PIM_DEBUG_TRACE)
|
||||||
zlog_debug("%s: %s is not installed in mroute",
|
zlog_debug("%s: %s is not installed in mroute",
|
||||||
__PRETTY_FUNCTION__, up->sg_str);
|
__PRETTY_FUNCTION__, up->sg_str);
|
||||||
@ -1613,7 +1621,7 @@ static void pim_upstream_sg_running(void *arg)
|
|||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: Handling unscanned inherited_olist for %s",
|
"%s: Handling unscanned inherited_olist for %s",
|
||||||
__PRETTY_FUNCTION__, up->sg_str);
|
__PRETTY_FUNCTION__, up->sg_str);
|
||||||
pim_upstream_inherited_olist_decide(pimg, up);
|
pim_upstream_inherited_olist_decide(pim, up);
|
||||||
up->channel_oil->oil_inherited_rescan = 0;
|
up->channel_oil->oil_inherited_rescan = 0;
|
||||||
}
|
}
|
||||||
pim_mroute_update_counters(up->channel_oil);
|
pim_mroute_update_counters(up->channel_oil);
|
||||||
|
@ -178,8 +178,9 @@ void pim_upstream_update_my_assert_metric(struct pim_upstream *up);
|
|||||||
void pim_upstream_keep_alive_timer_start(struct pim_upstream *up,
|
void pim_upstream_keep_alive_timer_start(struct pim_upstream *up,
|
||||||
uint32_t time);
|
uint32_t time);
|
||||||
|
|
||||||
int pim_upstream_switch_to_spt_desired(struct prefix_sg *sg);
|
int pim_upstream_switch_to_spt_desired(struct pim_instance *pim,
|
||||||
#define SwitchToSptDesired(sg) pim_upstream_switch_to_spt_desired (sg)
|
struct prefix_sg *sg);
|
||||||
|
#define SwitchToSptDesired(pim, sg) pim_upstream_switch_to_spt_desired (pim, sg)
|
||||||
int pim_upstream_is_sg_rpt(struct pim_upstream *up);
|
int pim_upstream_is_sg_rpt(struct pim_upstream *up);
|
||||||
|
|
||||||
void pim_upstream_set_sptbit(struct pim_upstream *up,
|
void pim_upstream_set_sptbit(struct pim_upstream *up,
|
||||||
|
Loading…
Reference in New Issue
Block a user