[pim] Correction for cross-compilation error with this syntax
diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c
index 82db37f..a0a4aa8 100644
--- a/pimd/pim_igmp.c
+++ b/pimd/pim_igmp.c
@@ -286,6 +286,7 @@
struct in_addr group_addr;
uint16_t recv_checksum;
uint16_t checksum;
+ int i;
group_addr = *(struct in_addr *)(igmp_msg + 4);
@@ -419,7 +420,7 @@
/* Scan sources in query and lower their timers to LMQT */
struct in_addr *sources = (struct in_addr *)(igmp_msg + IGMP_V3_SOURCES_OFFSET);
- for (int i = 0; i < recv_num_sources; ++i) {
+ for (i = 0; i < recv_num_sources; ++i) {
struct in_addr src_addr = sources[i];
struct igmp_source *src = igmp_find_source_by_addr(group, src_addr);
if (src) {
@@ -451,6 +452,7 @@
uint8_t *group_record;
uint8_t *report_pastend = (uint8_t *) igmp_msg + igmp_msg_len;
struct interface *ifp = igmp->interface;
+ int i;
if (igmp_msg_len < IGMP_V3_MSG_MIN_SIZE) {
zlog_warn("Recv IGMP report v3 from %s on %s: size=%d shorter than minimum=%d",
@@ -485,7 +487,7 @@
group_record = (uint8_t *) igmp_msg + IGMP_V3_REPORT_GROUPPRECORD_OFFSET;
/* Scan groups */
- for (int i = 0; i < num_groups; ++i) {
+ for (i = 0; i < num_groups; ++i) {
struct in_addr rec_group;
uint8_t *sources;
uint8_t *src;
diff --git a/pimd/pim_igmpv3.c b/pimd/pim_igmpv3.c
index 3d3ee7a..7e76f44 100644
--- a/pimd/pim_igmpv3.c
+++ b/pimd/pim_igmpv3.c
@@ -531,6 +531,7 @@
struct interface *ifp = igmp->interface;
struct pim_interface *pim_ifp;
struct igmp_group *group;
+ int i;
pim_ifp = ifp->info;
@@ -541,7 +542,7 @@
}
/* scan received sources */
- for (int i = 0; i < num_sources; ++i) {
+ for (i = 0; i < num_sources; ++i) {
struct igmp_source *source;
struct in_addr *src_addr;
@@ -580,6 +581,8 @@
static void isex_excl(struct igmp_group *group,
int num_sources, struct in_addr *sources)
{
+ int i;
+
/* EXCLUDE mode */
zassert(group->group_filtermode_isexcl);
@@ -587,7 +590,7 @@
source_mark_delete_flag(group->group_source_list);
/* scan received sources (A) */
- for (int i = 0; i < num_sources; ++i) {
+ for (i = 0; i < num_sources; ++i) {
struct igmp_source *source;
struct in_addr *src_addr;
@@ -621,6 +624,8 @@
static void isex_incl(struct igmp_group *group,
int num_sources, struct in_addr *sources)
{
+ int i;
+
/* INCLUDE mode */
zassert(!group->group_filtermode_isexcl);
@@ -628,7 +633,7 @@
source_mark_delete_flag(group->group_source_list);
/* scan received sources (B) */
- for (int i = 0; i < num_sources; ++i) {
+ for (i = 0; i < num_sources; ++i) {
struct igmp_source *source;
struct in_addr *src_addr;
@@ -702,12 +707,13 @@
{
struct igmp_sock *igmp = group->group_igmp_sock;
int num_sources_tosend = listcount(group->group_source_list);
+ int i;
/* Set SEND flag for all known sources (A) */
source_mark_send_flag(group->group_source_list);
/* Scan received sources (B) */
- for (int i = 0; i < num_sources; ++i) {
+ for (i = 0; i < num_sources; ++i) {
struct igmp_source *source;
struct in_addr *src_addr;
@@ -745,12 +751,13 @@
{
struct igmp_sock *igmp = group->group_igmp_sock;
int num_sources_tosend;
+ int i;
/* Set SEND flag for X (sources with timer > 0) */
num_sources_tosend = source_mark_send_flag_by_timer(group->group_source_list);
/* Scan received sources (A) */
- for (int i = 0; i < num_sources; ++i) {
+ for (i = 0; i < num_sources; ++i) {
struct igmp_source *source;
struct in_addr *src_addr;
@@ -821,6 +828,7 @@
int num_sources, struct in_addr *sources)
{
int num_sources_tosend = 0;
+ int i;
zassert(!group->group_filtermode_isexcl);
@@ -831,7 +839,7 @@
source_clear_send_flag(group->group_source_list);
/* Scan received sources (B) */
- for (int i = 0; i < num_sources; ++i) {
+ for (i = 0; i < num_sources; ++i) {
struct igmp_source *source;
struct in_addr *src_addr;
@@ -878,6 +886,7 @@
int num_sources, struct in_addr *sources)
{
int num_sources_tosend = 0;
+ int i;
/* set DELETE flag for all known sources (X,Y) */
source_mark_delete_flag(group->group_source_list);
@@ -886,7 +895,7 @@
source_clear_send_flag(group->group_source_list);
/* scan received sources (A) */
- for (int i = 0; i < num_sources; ++i) {
+ for (i = 0; i < num_sources; ++i) {
struct igmp_source *source;
struct in_addr *src_addr;
@@ -1392,12 +1401,13 @@
int num_sources, struct in_addr *sources)
{
int num_sources_tosend = 0;
+ int i;
/* 1. clear off SEND flag from all known sources (X,Y) */
source_clear_send_flag(group->group_source_list);
/* 2. scan received sources (A) */
- for (int i = 0; i < num_sources; ++i) {
+ for (i = 0; i < num_sources; ++i) {
struct igmp_source *source;
struct in_addr *src_addr;
@@ -1438,12 +1448,13 @@
int num_sources, struct in_addr *sources)
{
int num_sources_tosend = 0;
+ int i;
/* 1. clear off SEND flag from all known sources (B) */
source_clear_send_flag(group->group_source_list);
/* 2. scan received sources (A) */
- for (int i = 0; i < num_sources; ++i) {
+ for (i = 0; i < num_sources; ++i) {
struct igmp_source *source;
struct in_addr *src_addr;