]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: move variable declartion outside of switch 726/head
authorChirag Shah <chirag@cumulusnetworks.com>
Thu, 15 Jun 2017 19:20:59 +0000 (12:20 -0700)
committerChirag Shah <chirag@cumulusnetworks.com>
Thu, 15 Jun 2017 19:20:59 +0000 (12:20 -0700)
To Address ICC (intel CC) warning, moving variables
declaration out of switch statement.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
pimd/pim_nht.c

index 01ba2039fbb40c913ebe891187fa80b95ed8b4c4..4aa6ecd5f3b1d22ac820afd486607a48b97daf6b 100644 (file)
@@ -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 ("<nht_nbr?>", 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;