up->channel_oil = oil;
up->channel_oil->cc.pktcnt++;
- up->fhr = 1;
+ PIM_UPSTREAM_FLAG_SET_FHR(up->flags);
pim_channel_add_oif (up->channel_oil, pim_regiface, PIM_OIF_FLAG_PROTO_PIM);
up->join_state = PIM_UPSTREAM_JOINED;
* If we are the fhr that means we are getting a callback during
* the pimreg period, so I believe we can ignore this packet
*/
- if (!up->fhr)
+ if (!PIM_UPSTREAM_FLAG_TEST_FHR(up->flags))
{
struct pim_nexthop source;
struct pim_rpf *rpf = RP (sg.grp);
pim_str_sg_dump (&sg), ifp->name);
return -2;
}
- up->fhr = 1;
+ PIM_UPSTREAM_FLAG_SET_FHR(up->flags);
pim_upstream_keep_alive_timer_start (up, qpim_keep_alive_time);
up->channel_oil = oil;
/*
* In the case of a HFR we will not ahve anyone to send this to.
*/
- if (up->fhr)
+ if (PIM_UPSTREAM_FLAG_TEST_FHR(up->flags))
return 0;
/*
switch (up->join_state)
{
case PIM_UPSTREAM_PRUNE:
- if (!up->fhr)
+ if (!PIM_UPSTREAM_FLAG_TEST_FHR(up->flags))
{
up->join_state = new_state;
up->state_transition = pim_time_monotonic_sec ();
if (new_state == PIM_UPSTREAM_JOINED) {
if (old_state != PIM_UPSTREAM_JOINED)
{
- int old_fhr = up->fhr;
+ int old_fhr = PIM_UPSTREAM_FLAG_TEST_FHR(up->flags);
forward_on(up);
- up->fhr = pim_upstream_could_register (up);
- if (up->fhr)
+ if (pim_upstream_could_register (up))
{
+ PIM_UPSTREAM_FLAG_SET_FHR(up->flags);
if (!old_fhr)
{
pim_upstream_keep_alive_timer_start (up, qpim_keep_alive_time);
*/
struct pim_upstream {
struct pim_upstream *parent;
- int fhr;
struct in_addr upstream_addr;/* Who we are talking to */
struct in_addr upstream_register; /*Who we received a register from*/
struct prefix_sg sg; /* (S,G) group key */