diff options
| author | Jafar Al-Gharaibeh <Jafaral@users.noreply.github.com> | 2017-03-31 00:15:23 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-31 00:15:23 -0500 |
| commit | 2b5c7fa46d98ea35f6febd5b3da32ca0a2445ca2 (patch) | |
| tree | f2f90cc6427bd7a279b7d08d14a3aed7064fb200 /pimd/pim_mroute.c | |
| parent | d77005377fed5fd895eeecf4784311cdba838480 (diff) | |
| parent | 31edf0b50978c4fbe2502923ab50b6a640921f38 (diff) | |
Merge pull request #291 from AnuradhaKaruppiah/pim-ssm
Pim ssm
Diffstat (limited to 'pimd/pim_mroute.c')
| -rw-r--r-- | pimd/pim_mroute.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index 04b6a4c697..90e30ea3d6 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -39,6 +39,7 @@ #include "pim_register.h" #include "pim_ifchannel.h" #include "pim_zlookup.h" +#include "pim_ssm.h" /* GLOBAL VARS */ static struct thread *qpim_mroute_socket_reader = NULL; @@ -127,8 +128,7 @@ pim_mroute_msg_nocache (int fd, struct interface *ifp, const struct igmpmsg *msg */ if ((pim_rpf_addr_is_inaddr_none (rpg)) || (!pim_ifp) || - (!(PIM_I_am_DR(pim_ifp))) || - (pim_ifp->itype == PIM_INTERFACE_SSM)) + (!(PIM_I_am_DR(pim_ifp)))) { if (PIM_DEBUG_MROUTE_DETAIL) zlog_debug ("%s: Interface is not configured correctly to handle incoming packet: Could be !DR, !pim_ifp, !SM, !RP", @@ -178,8 +178,7 @@ pim_mroute_msg_nocache (int fd, struct interface *ifp, const struct igmpmsg *msg up->channel_oil->cc.pktcnt++; PIM_UPSTREAM_FLAG_SET_FHR(up->flags); - pim_channel_add_oif (up->channel_oil, pim_regiface, PIM_OIF_FLAG_PROTO_PIM); - up->reg_state = PIM_REG_JOIN; + pim_register_join (up); return 0; } @@ -214,8 +213,7 @@ pim_mroute_msg_wholepkt (int fd, struct interface *ifp, const char *buf) if ((pim_rpf_addr_is_inaddr_none (rpg)) || (!pim_ifp) || - (!(PIM_I_am_DR(pim_ifp))) || - (pim_ifp->itype == PIM_INTERFACE_SSM)) { + (!(PIM_I_am_DR(pim_ifp)))) { if (PIM_DEBUG_MROUTE) { zlog_debug("%s: Failed Check send packet", __PRETTY_FUNCTION__); } @@ -226,9 +224,18 @@ pim_mroute_msg_wholepkt (int fd, struct interface *ifp, const char *buf) * If we've received a register suppress */ if (!up->t_rs_timer) - pim_register_send((uint8_t *)buf + sizeof(struct ip), - ntohs (ip_hdr->ip_len) - sizeof (struct ip), - pim_ifp->primary_address, rpg, 0, up); + { + if (pim_is_grp_ssm (sg.grp)) + { + if (PIM_DEBUG_PIM_REG) + zlog_debug ("%s register forward skipped as group is SSM", + pim_str_sg_dump (&sg)); + return 0; + } + pim_register_send((uint8_t *)buf + sizeof(struct ip), + ntohs (ip_hdr->ip_len) - sizeof (struct ip), + pim_ifp->primary_address, rpg, 0, up); + } return 0; } @@ -442,8 +449,7 @@ pim_mroute_msg_wrvifwhole (int fd, struct interface *ifp, const char *buf) pim_upstream_keep_alive_timer_start (up, qpim_keep_alive_time); up->channel_oil = oil; up->channel_oil->cc.pktcnt++; - pim_channel_add_oif (up->channel_oil, pim_regiface, PIM_OIF_FLAG_PROTO_PIM); - up->reg_state = PIM_REG_JOIN; + pim_register_join (up); pim_upstream_inherited_olist (up); // Send the packet to the RP |
