diff options
| -rw-r--r-- | pimd/pim_igmp.c | 13 | ||||
| -rw-r--r-- | pimd/pim_igmp.h | 6 | ||||
| -rw-r--r-- | pimd/pim_igmpv3.c | 51 | ||||
| -rw-r--r-- | pimd/pim_zebra.c | 17 |
4 files changed, 31 insertions, 56 deletions
diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c index 4fd3edcb88..2b9bb0fdeb 100644 --- a/pimd/pim_igmp.c +++ b/pimd/pim_igmp.c @@ -621,7 +621,7 @@ static int igmp_v2_report(struct igmp_sock *igmp, memcpy(&group_addr, igmp_msg + 4, sizeof(struct in_addr)); /* non-existant group is created as INCLUDE {empty} */ - group = igmp_add_group_by_addr(igmp, group_addr, ifp->name); + group = igmp_add_group_by_addr(igmp, group_addr); if (!group) { return -1; } @@ -678,7 +678,7 @@ static int igmp_v1_report(struct igmp_sock *igmp, memcpy(&group_addr, igmp_msg + 4, sizeof(struct in_addr)); /* non-existant group is created as INCLUDE {empty} */ - group = igmp_add_group_by_addr(igmp, group_addr, ifp->name); + group = igmp_add_group_by_addr(igmp, group_addr); if (!group) { return -1; } @@ -1356,8 +1356,7 @@ static struct igmp_group *find_group_by_addr(struct igmp_sock *igmp, } struct igmp_group *igmp_add_group_by_addr(struct igmp_sock *igmp, - struct in_addr group_addr, - const char *ifname) + struct in_addr group_addr) { struct igmp_group *group; @@ -1395,8 +1394,8 @@ struct igmp_group *igmp_add_group_by_addr(struct igmp_sock *igmp, } group->group_source_list->del = (void (*)(void *)) igmp_source_free; - group->t_group_timer = 0; - group->t_group_query_retransmit_timer = 0; + group->t_group_timer = NULL; + group->t_group_query_retransmit_timer = NULL; group->group_specific_query_retransmit_count = 0; group->group_addr = group_addr; group->group_igmp_sock = igmp; @@ -1413,7 +1412,7 @@ struct igmp_group *igmp_add_group_by_addr(struct igmp_sock *igmp, char group_str[100]; pim_inet4_dump("<group?>", group->group_addr, group_str, sizeof(group_str)); zlog_debug("Creating new IGMP group %s on socket %d interface %s", - group_str, group->group_igmp_sock->fd, ifname); + group_str, igmp->fd, igmp->interface->name); } /* diff --git a/pimd/pim_igmp.h b/pimd/pim_igmp.h index d45f223ba8..ab396159e3 100644 --- a/pimd/pim_igmp.h +++ b/pimd/pim_igmp.h @@ -163,8 +163,7 @@ struct igmp_group { }; struct igmp_group *igmp_add_group_by_addr(struct igmp_sock *igmp, - struct in_addr group_addr, - const char *ifname); + struct in_addr group_addr); void igmp_group_delete_empty_include(struct igmp_group *group); @@ -173,4 +172,7 @@ void igmp_startup_mode_on(struct igmp_sock *igmp); void igmp_group_timer_on(struct igmp_group *group, long interval_msec, const char *ifname); +struct igmp_source * +source_new (struct igmp_group *group, + struct in_addr src_addr); #endif /* PIM_IGMP_H */ diff --git a/pimd/pim_igmpv3.c b/pimd/pim_igmpv3.c index 3657f2f946..8a32a32729 100644 --- a/pimd/pim_igmpv3.c +++ b/pimd/pim_igmpv3.c @@ -477,9 +477,9 @@ struct igmp_source *igmp_find_source_by_addr(struct igmp_group *group, return 0; } -static struct igmp_source *source_new(struct igmp_group *group, - struct in_addr src_addr, - const char *ifname) +struct igmp_source * +source_new (struct igmp_group *group, + struct in_addr src_addr) { struct igmp_source *src; @@ -491,7 +491,7 @@ static struct igmp_source *source_new(struct igmp_group *group, zlog_debug("Creating new IGMP source %s for group %s on socket %d interface %s", source_str, group_str, group->group_igmp_sock->fd, - ifname); + group->group_igmp_sock->interface->name); } src = XMALLOC(MTYPE_PIM_IGMP_GROUP_SOURCE, sizeof(*src)); @@ -501,13 +501,13 @@ static struct igmp_source *source_new(struct igmp_group *group, return 0; /* error, not found, could not create */ } - src->t_source_timer = 0; + src->t_source_timer = NULL; src->source_group = group; /* back pointer */ src->source_addr = src_addr; src->source_creation = pim_time_monotonic_sec(); src->source_flags = 0; src->source_query_retransmit_count = 0; - src->source_channel_oil = 0; + src->source_channel_oil = NULL; listnode_add(group->group_source_list, src); @@ -521,8 +521,7 @@ static struct igmp_source *source_new(struct igmp_group *group, static struct igmp_source *add_source_by_addr(struct igmp_sock *igmp, struct igmp_group *group, - struct in_addr src_addr, - const char *ifname) + struct in_addr src_addr) { struct igmp_source *src; @@ -531,7 +530,7 @@ static struct igmp_source *add_source_by_addr(struct igmp_sock *igmp, return src; } - src = source_new(group, src_addr, ifname); + src = source_new(group, src_addr); if (!src) { return 0; } @@ -543,12 +542,11 @@ static void allow(struct igmp_sock *igmp, struct in_addr from, struct in_addr group_addr, int num_sources, struct in_addr *sources) { - struct interface *ifp = igmp->interface; struct igmp_group *group; int i; /* non-existant group is created as INCLUDE {empty} */ - group = igmp_add_group_by_addr(igmp, group_addr, ifp->name); + group = igmp_add_group_by_addr(igmp, group_addr); if (!group) { return; } @@ -560,7 +558,7 @@ static void allow(struct igmp_sock *igmp, struct in_addr from, src_addr = sources + i; - source = add_source_by_addr(igmp, group, *src_addr, ifp->name); + source = add_source_by_addr(igmp, group, *src_addr); if (!source) { continue; } @@ -616,8 +614,7 @@ static void isex_excl(struct igmp_group *group, } else { /* E.4: if not found, create source with timer=GMI: (A-X-Y) */ - source = source_new(group, *src_addr, - group->group_igmp_sock->interface->name); + source = source_new(group, *src_addr); if (!source) { /* ugh, internal malloc failure, skip source */ continue; @@ -659,8 +656,7 @@ static void isex_incl(struct igmp_group *group, } else { /* I.4: if not found, create source with timer=0 (B-A) */ - source = source_new(group, *src_addr, - group->group_igmp_sock->interface->name); + source = source_new(group, *src_addr); if (!source) { /* ugh, internal malloc failure, skip source */ continue; @@ -691,7 +687,7 @@ void igmpv3_report_isex(struct igmp_sock *igmp, struct in_addr from, ifp, from, group_addr, num_sources, sources); /* non-existant group is created as INCLUDE {empty} */ - group = igmp_add_group_by_addr(igmp, group_addr, ifp->name); + group = igmp_add_group_by_addr(igmp, group_addr); if (!group) { return; } @@ -737,8 +733,7 @@ static void toin_incl(struct igmp_group *group, } else { /* If not found, create new source */ - source = source_new(group, *src_addr, - group->group_igmp_sock->interface->name); + source = source_new(group, *src_addr); if (!source) { /* ugh, internal malloc failure, skip source */ continue; @@ -783,8 +778,7 @@ static void toin_excl(struct igmp_group *group, } else { /* If not found, create new source */ - source = source_new(group, *src_addr, - group->group_igmp_sock->interface->name); + source = source_new(group, *src_addr); if (!source) { /* ugh, internal malloc failure, skip source */ continue; @@ -815,7 +809,7 @@ void igmpv3_report_toin(struct igmp_sock *igmp, struct in_addr from, ifp, from, group_addr, num_sources, sources); /* non-existant group is created as INCLUDE {empty} */ - group = igmp_add_group_by_addr(igmp, group_addr, ifp->name); + group = igmp_add_group_by_addr(igmp, group_addr); if (!group) { return; } @@ -862,8 +856,7 @@ static void toex_incl(struct igmp_group *group, } else { /* If source not found, create source with timer=0: (B-A)=0 */ - source = source_new(group, *src_addr, - group->group_igmp_sock->interface->name); + source = source_new(group, *src_addr); if (!source) { /* ugh, internal malloc failure, skip source */ continue; @@ -916,8 +909,7 @@ static void toex_excl(struct igmp_group *group, else { /* if not found, create source with Group Timer: (A-X-Y)=Group Timer */ long group_timer_msec; - source = source_new(group, *src_addr, - group->group_igmp_sock->interface->name); + source = source_new(group, *src_addr); if (!source) { /* ugh, internal malloc failure, skip source */ continue; @@ -967,7 +959,7 @@ void igmpv3_report_toex(struct igmp_sock *igmp, struct in_addr from, ifp, from, group_addr, num_sources, sources); /* non-existant group is created as INCLUDE {empty} */ - group = igmp_add_group_by_addr(igmp, group_addr, ifp->name); + group = igmp_add_group_by_addr(igmp, group_addr); if (!group) { return; } @@ -1421,8 +1413,7 @@ static void block_excl(struct igmp_group *group, if (!source) { /* 3: if not found, create source with Group Timer: (A-X-Y)=Group Timer */ long group_timer_msec; - source = source_new(group, *src_addr, - group->group_igmp_sock->interface->name); + source = source_new(group, *src_addr); if (!source) { /* ugh, internal malloc failure, skip source */ continue; @@ -1489,7 +1480,7 @@ void igmpv3_report_block(struct igmp_sock *igmp, struct in_addr from, ifp, from, group_addr, num_sources, sources); /* non-existant group is created as INCLUDE {empty} */ - group = igmp_add_group_by_addr(igmp, group_addr, ifp->name); + group = igmp_add_group_by_addr(igmp, group_addr); if (!group) { return; } diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index b3e61f2b06..eaf1b08078 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -52,23 +52,6 @@ static int del_oif(struct channel_oil *channel_oil, struct interface *oif, uint32_t proto_mask); -#if 0 -static void zclient_broken(struct zclient *zclient) -{ - struct listnode *ifnode; - struct interface *ifp; - - zlog_warn("%s %s: broken zclient connection", - __FILE__, __PRETTY_FUNCTION__); - - for (ALL_LIST_ELEMENTS_RO(iflist, ifnode, ifp)) { - pim_if_addr_del_all(ifp); - } - - /* upon return, zclient will discard connected addresses */ -} -#endif - /* Router-id update message from zebra. */ static int pim_router_id_update_zebra(int command, struct zclient *zclient, zebra_size_t length, vrf_id_t vrf_id) |
