From 925574ba66762cabcffc81cee424aea4e5cb68d9 Mon Sep 17 00:00:00 2001 From: Chirag Shah Date: Thu, 15 Jun 2017 12:20:59 -0700 Subject: [PATCH] pimd: move variable declartion outside of switch To Address ICC (intel CC) warning, moving variables declaration out of switch statement. Signed-off-by: Chirag Shah --- pimd/pim_nht.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pimd/pim_nht.c b/pimd/pim_nht.c index 01ba2039fb..4aa6ecd5f3 100644 --- a/pimd/pim_nht.c +++ b/pimd/pim_nht.c @@ -531,8 +531,8 @@ pim_ecmp_nexthop_search (struct pim_nexthop_cache *pnc, curr_route_valid = (nexthop->interface->ifindex == nh_node->ifindex); if (curr_route_valid && - !pim_if_connected_to_source (nexthop->interface, - src->u.prefix4)) + !pim_if_connected_to_source (nexthop->interface, + src->u.prefix4)) { nbr = pim_neighbor_find (nexthop->interface, nexthop->mrib_nexthop_addr.u.prefix4); @@ -678,6 +678,9 @@ pim_parse_nexthop_update (int command, struct zclient *zclient, struct pim_nexthop_cache *pnc = NULL; struct pim_neighbor *nbr = NULL; struct interface *ifp = NULL; + struct interface *ifp1 = NULL; + struct pim_interface *pim_ifp = NULL; + char str[INET_ADDRSTRLEN]; s = zclient->ibuf; memset (&p, 0, sizeof (struct prefix)); @@ -753,7 +756,7 @@ pim_parse_nexthop_update (int command, struct zclient *zclient, case NEXTHOP_TYPE_IPV6_IFINDEX: stream_get (&nexthop->gate.ipv6, s, 16); nexthop->ifindex = stream_getl (s); - struct interface *ifp1 = if_lookup_by_index (nexthop->ifindex, VRF_DEFAULT); + ifp1 = if_lookup_by_index (nexthop->ifindex, VRF_DEFAULT); nbr = pim_neighbor_find_if (ifp1); /* Overwrite with Nbr address as NH addr */ if (nbr) @@ -761,21 +764,20 @@ pim_parse_nexthop_update (int command, struct zclient *zclient, nexthop->gate.ipv4 = nbr->source_addr; if (PIM_DEBUG_TRACE) { - char str[INET_ADDRSTRLEN]; pim_inet4_dump ("", nbr->source_addr, str, sizeof (str)); zlog_debug ("%s: NHT using pim nbr addr %s interface %s as rpf", - __PRETTY_FUNCTION__, str, ifp1->name); + __PRETTY_FUNCTION__, str, ifp1->name); } } else { if (PIM_DEBUG_TRACE) { - struct pim_interface *pim_ifp = ifp1->info; + pim_ifp = ifp1->info; zlog_debug ("%s: NHT pim nbr not found on interface %s nbr count:%d ", - __PRETTY_FUNCTION__, ifp1->name, - pim_ifp->pim_neighbor_list->count); + __PRETTY_FUNCTION__, ifp1->name, + pim_ifp->pim_neighbor_list->count); } //Mark nexthop address to 0 until PIM Nbr is resolved. nexthop->gate.ipv4.s_addr = PIM_NET_INADDR_ANY; -- 2.39.5