]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd: ospfd-warnings.patch
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 20 May 2015 01:29:14 +0000 (18:29 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 20 May 2015 01:29:14 +0000 (18:29 -0700)
Remove compile warnings for the ospfd/ospf6d directory
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:

20 files changed:
ospf6d/ospf6_area.c
ospf6d/ospf6_asbr.c
ospf6d/ospf6_flood.c
ospf6d/ospf6_interface.c
ospf6d/ospf6_lsa.c
ospf6d/ospf6_neighbor.h
ospf6d/ospf6_network.c
ospf6d/ospf6_route.c
ospf6d/ospf6_route.h
ospf6d/ospf6_spf.c
ospf6d/ospf6_top.c
ospfd/ospf_api.c
ospfd/ospf_ase.c
ospfd/ospf_dump.c
ospfd/ospf_flood.c
ospfd/ospf_packet.c
ospfd/ospf_routemap.c
ospfd/ospf_spf.c
ospfd/ospf_zebra.c
ospfd/ospfd.c

index ac2fc378bb11e2a4f6ca61ea94825081c09e24a5..71787541e641e2f1399388895ec2f7bc5474c8d8 100644 (file)
@@ -676,13 +676,11 @@ DEFUN (no_area_filter_list,
        "Filter networks sent from this area\n")
 {
   struct ospf6_area *area;
-  struct prefix_list *plist;
 
   OSPF6_CMD_AREA_GET (argv[0], area);
   argc--;
   argv++;
 
-  plist = prefix_list_lookup (AFI_IP6, argv[0]);
   if (strncmp (argv[1], "in", 2) == 0)
     {
       if (PREFIX_NAME_IN (area))
index b39bfdc49ffe4c6a3b92d5337862661b094370c3..9f5337cc61ff544635f53190c51a9285ec8ed625 100644 (file)
@@ -58,18 +58,13 @@ ospf6_as_external_lsa_originate (struct ospf6_route *route)
 {
   char buffer[OSPF6_MAX_LSASIZE];
   struct ospf6_lsa_header *lsa_header;
-  struct ospf6_lsa *old, *lsa;
+  struct ospf6_lsa *lsa;
   struct ospf6_external_info *info = route->route_option;
 
   struct ospf6_as_external_lsa *as_external_lsa;
   char buf[64];
   caddr_t p;
 
-  /* find previous LSA */
-  old = ospf6_lsdb_lookup (htons (OSPF6_LSTYPE_AS_EXTERNAL),
-                           route->path.origin.id, ospf6->router_id,
-                           ospf6->lsdb);
-
   if (IS_OSPF6_DEBUG_ASBR || IS_OSPF6_DEBUG_ORIGINATE (AS_EXTERNAL))
     {
       prefix2str (&route->prefix, buf, sizeof (buf));
index b17406f247e66ee30b1f468335b5deccc2da8571..14c16c02418fa7259814acc92d2d51a0c388e41c 100644 (file)
@@ -760,7 +760,7 @@ ospf6_receive_lsa (struct ospf6_neighbor *from,
   struct ospf6_lsa *new = NULL, *old = NULL, *rem = NULL;
   int ismore_recent;
   int is_debug = 0;
-  int time_delta_ms;
+  unsigned int time_delta_ms;
 
   ismore_recent = 1;
   assert (from);
index 3d06ce3908186f29ec122cb692271f0afe0100e9..5043be4358ef1ec1d2678a823ecbfd1430404eaf 100644 (file)
@@ -1295,7 +1295,6 @@ DEFUN (no_ipv6_ospf6_cost,
 {
   struct ospf6_interface *oi;
   struct interface *ifp;
-  unsigned long int lcost;
 
   ifp = (struct interface *) vty->index;
   assert (ifp);
index 2e6153557d175cbaf8be3994ce0b5b9de1a64e5d..4a4fa0f9f08fcea3ef3068ff4cf3ab5cb428952d 100644 (file)
@@ -493,8 +493,8 @@ ospf6_lsa_show_internal (struct vty *vty, struct ospf6_lsa *lsa)
   vty_out (vty, "Flag: %x %s", lsa->flag, VNL);
   vty_out (vty, "Lock: %d %s", lsa->lock, VNL);
   vty_out (vty, "ReTx Count: %d%s", lsa->retrans_count, VNL);
-  vty_out (vty, "Threads: Expire: %x, Refresh: %x %s",
-          lsa->expire, lsa->refresh, VNL);
+  vty_out (vty, "Threads: Expire: %llx, Refresh: %llx %s",
+          (unsigned long long)lsa->expire, (unsigned long long)lsa->refresh, VNL);
   vty_out (vty, "%s", VNL);
   return;
 }
index 65c43fd2e9d27093d7dcf857a61f9bc3037a6519..cba2cb99daf0847362e606edab4d0d21a54910cc 100644 (file)
@@ -137,7 +137,7 @@ static const char *ospf6_neighbor_event_str[] =
     "InactivityTimer",
   };
 
-static const char *ospf6_neighbor_event_string (int event)
+static inline const char *ospf6_neighbor_event_string (int event)
 {
   #define OSPF6_NEIGHBOR_UNKNOWN_EVENT_STRING "UnknownEvent"
 
index 954c1f6f295a430cd2df747b8c48a1e69add8e3d..0d53d3ee7f34fd8124e647eca6d003135f774092 100644 (file)
@@ -64,7 +64,7 @@ ospf6_set_pktinfo (void)
   setsockopt_ipv6_pktinfo (ospf6_sock, 1);
 }
 
-void
+static void
 ospf6_set_transport_class (void)
 {
 #ifdef IPTOS_PREC_INTERNETCONTROL
index 4ef5b7c2fcf54462cf8850a047e9c2a4a1dcf86b..38fc0c50565b091934455d7824bafac03b6ad2cd 100644 (file)
@@ -375,7 +375,7 @@ ospf6_route_get_first_nh_index (struct ospf6_route *route)
 
   if (route)
     {
-      if (nh = (struct ospf6_nexthop *)listhead (route->nh_list))
+      if ((nh = (struct ospf6_nexthop *)listhead (route->nh_list)))
        return (nh->ifindex);
     }
 
index b0e43874a7a51673fb159472f9884e8976e3e039..e5bfc5ed041b467e2e5c4c57577ae3f66a5bab1f 100644 (file)
@@ -248,14 +248,12 @@ extern const char *ospf6_path_type_substr[OSPF6_PATH_TYPE_MAX];
 #define ospf6_route_is_best(r) (CHECK_FLAG ((r)->flag, OSPF6_ROUTE_BEST))
 
 #define ospf6_linkstate_prefix_adv_router(x) \
-  (*(u_int32_t *)(&(x)->u.prefix6.s6_addr[0]))
+  ((x)->u.prefix4.s_addr)
 #define ospf6_linkstate_prefix_id(x) \
-  (*(u_int32_t *)(&(x)->u.prefix6.s6_addr[4]))
+  ((x)->u.prefix6.s6_addr32[1])
 
 #define ADV_ROUTER_IN_PREFIX(x) \
-  (*(u_int32_t *)(&(x)->u.prefix6.s6_addr[0]))
-#define ID_IN_PREFIX(x) \
-  (*(u_int32_t *)(&(x)->u.prefix6.s6_addr[4]))
+  ((x)->u.prefix4.s_addr)
 
 /* Function prototype */
 extern void ospf6_linkstate_prefix (u_int32_t adv_router, u_int32_t id,
index 3713c51517c54b7a4f008b12433124637683db54..02fd14b76b94c865bfb772491e7ee7661d14051b 100644 (file)
@@ -61,7 +61,7 @@ ospf6_spf_merge_nexthops_to_route (struct ospf6_route *rt,
     ospf6_merge_nexthops (rt->nh_list, v->nh_list);
 }
 
-static int
+static unsigned int
 ospf6_spf_get_ifindex_from_nh (struct ospf6_vertex *v)
 {
   struct ospf6_nexthop *nh;
@@ -77,7 +77,7 @@ ospf6_spf_get_ifindex_from_nh (struct ospf6_vertex *v)
            return (nh->ifindex);
        }
     }
-  return -1;
+  return 0;
 }
 
 static int
@@ -264,7 +264,7 @@ ospf6_nexthop_calc (struct ospf6_vertex *w, struct ospf6_vertex *v,
                     caddr_t lsdesc)
 {
   int i;
-  int ifindex;
+  unsigned int ifindex;
   struct ospf6_interface *oi;
   u_int16_t type;
   u_int32_t adv_router;
@@ -275,7 +275,7 @@ ospf6_nexthop_calc (struct ospf6_vertex *w, struct ospf6_vertex *v,
   assert (VERTEX_IS_TYPE (ROUTER, w));
   ifindex = (VERTEX_IS_TYPE (NETWORK, v) ? ospf6_spf_get_ifindex_from_nh (v) :
              ROUTER_LSDESC_GET_IFID (lsdesc));
-  if (ifindex == -1)
+  if (ifindex == 0)
     {
       zlog_err ("No nexthop ifindex at vertex %s", v->name);
       return;
@@ -436,7 +436,7 @@ static const char *ospf6_spf_reason_str[] =
 
 void ospf6_spf_reason_string (unsigned int reason, char *buf, int size)
 {
-  int bit;
+  unsigned int bit;
   int len = 0;
 
   if (!buf)
@@ -594,7 +594,6 @@ ospf6_spf_calculation_thread (struct thread *t)
   struct ospf6 *ospf6;
   struct timeval start, end, runtime;
   struct listnode *node;
-  struct ospf6_route *route;
   int areas_processed = 0;
   char rbuf[32];
 
index 424902fff597177c26fc168d252f2b64e8f4bc12..c90c0a07d6e6dd6221a353dff609c610939c3602 100644 (file)
@@ -184,20 +184,6 @@ ospf6_delete (struct ospf6 *o)
   XFREE (MTYPE_OSPF6_TOP, o);
 }
 
-static void
-ospf6_enable (struct ospf6 *o)
-{
-  struct listnode *node, *nnode;
-  struct ospf6_area *oa;
-
-  if (CHECK_FLAG (o->flag, OSPF6_DISABLED))
-    {
-      UNSET_FLAG (o->flag, OSPF6_DISABLED);
-      for (ALL_LIST_ELEMENTS (o->area_list, node, nnode, oa))
-        ospf6_area_enable (oa);
-    }
-}
-
 static void
 ospf6_disable (struct ospf6 *o)
 {
@@ -224,7 +210,7 @@ ospf6_disable (struct ospf6 *o)
     }
 }
 
-int
+static int
 ospf6_maxage_remover (struct thread *thread)
 {
   struct ospf6 *o = (struct ospf6 *) THREAD_ARG (thread);
@@ -540,14 +526,11 @@ DEFUN (no_ospf6_interface_area,
        "OSPF6 area ID in IPv4 address notation\n"
        )
 {
-  struct ospf6 *o;
   struct ospf6_interface *oi;
   struct ospf6_area *oa;
   struct interface *ifp;
   u_int32_t area_id;
 
-  o = (struct ospf6 *) vty->index;
-
   ifp = if_lookup_by_name (argv[0]);
   if (ifp == NULL)
     {
index fae942ec2011308e5c5e5c18943db0740c0e2902..45525f4a2ca840b454d8a44dc60a43885126aa22 100644 (file)
@@ -464,7 +464,7 @@ new_msg_register_event (u_int32_t seqnum, struct lsa_filter_type *filter)
 {
   u_char buf[OSPF_API_MAX_MSG_SIZE];
   struct msg_register_event *emsg;
-  int len;
+  unsigned int len;
 
   emsg = (struct msg_register_event *) buf;
   len = sizeof (struct msg_register_event) +
@@ -483,7 +483,7 @@ new_msg_sync_lsdb (u_int32_t seqnum, struct lsa_filter_type *filter)
 {
   u_char buf[OSPF_API_MAX_MSG_SIZE];
   struct msg_sync_lsdb *smsg;
-  int len;
+  unsigned int len;
 
   smsg = (struct msg_sync_lsdb *) buf;
   len = sizeof (struct msg_sync_lsdb) +
@@ -504,7 +504,7 @@ new_msg_originate_request (u_int32_t seqnum,
                           struct in_addr area_id, struct lsa_header *data)
 {
   struct msg_originate_request *omsg;
-  int omsglen;
+  unsigned int omsglen;
   char buf[OSPF_API_MAX_MSG_SIZE];
 
   omsg = (struct msg_originate_request *) buf;
@@ -630,7 +630,7 @@ new_msg_lsa_change_notify (u_char msgtype,
 {
   u_char buf[OSPF_API_MAX_MSG_SIZE];
   struct msg_lsa_change_notify *nmsg;
-  int len;
+  unsigned int len;
 
   assert (data);
 
index 9038b3a5c69597594463861466b04a7044f2b7aa..8aedc808844734eb3eb35ec0afe028ba52de6232 100644 (file)
@@ -679,7 +679,7 @@ ospf_ase_calculate_timer (struct thread *t)
 
       quagga_gettime(QUAGGA_CLK_MONOTONIC, &stop_time);
 
-      zlog_info ("SPF Processing Time(usecs): External Routes: %d\n",
+      zlog_info ("SPF Processing Time(usecs): External Routes: %ld\n",
                 (stop_time.tv_sec - start_time.tv_sec)*1000000L+
                 (stop_time.tv_usec - start_time.tv_usec));
     }
index af5cbf534ef1171673de7d994529f474e3e53d18..9c73e1b2bede8ded53c51765ac5132abaf7f71c3 100644 (file)
@@ -2081,8 +2081,6 @@ config_write_debug (struct vty *vty)
 
   if (ospf->instance)
     sprintf(str, " %d", ospf->instance);
-  else
-    sprintf(str, "");
 
   /* debug ospf ism (status|events|timers). */
   if (IS_CONF_DEBUG_OSPF (ism, ISM) == OSPF_DEBUG_ISM)
index 9ab46b9c9e9d08f8df14ae1a129670b20b6a7fba..36fc4650e0da88012bbf28fdfb9999c31fc87ddd 100644 (file)
@@ -108,6 +108,7 @@ ospf_external_info_check (struct ospf_lsa *lsa)
 
           for (ALL_LIST_ELEMENTS_RO(ext_list, node, ext))
             {
+             rn = NULL;
               if (ext->external_info)
                 rn = route_node_lookup (ext->external_info,
                                         (struct prefix *) &p);
index 44ee806e3ff7590041b9e4b55615f3bde3d06bfb..ee1e99250d3c0bfffe3a63d40cce67958c170fb8 100644 (file)
@@ -217,13 +217,6 @@ ospf_fifo_flush (struct ospf_fifo *fifo)
   fifo->count = 0;
 }
 
-/* Return the current fifo count */
-static int
-ospf_fifo_count (struct ospf_fifo *fifo)
-{
-       return (fifo->count);
-}
-
 /* Free ospf packet fifo. */
 void
 ospf_fifo_free (struct ospf_fifo *fifo)
index 6e02de3a16becbe38a0f707db3d986943275c771..b2f1c6712686db762e8e24b0016b4a262de69a44 100644 (file)
@@ -45,7 +45,6 @@ ospf_route_map_update (const char *name)
 {
   struct ospf *ospf;
   int type;
-  u_short instance; // PENDING
 
   /* If OSPF instatnce does not exist, return right now. */
   ospf = ospf_lookup ();
@@ -532,15 +531,18 @@ route_set_metric_compile (const char *arg)
      set metric <+/-metric> check
      Ignore the +/- component */
   if (! all_digit (arg))
-    if ((strncmp (arg, "+", 1) == 0 || strncmp (arg, "-", 1) == 0) &&
-        all_digit (arg+1))
-      {
-        zlog_warn ("OSPF does not support 'set metric +/-'");
-        arg++;
-      }
-    else
-      return NULL;
-
+    {
+      if ((strncmp (arg, "+", 1) == 0 || strncmp (arg, "-", 1) == 0) &&
+         all_digit (arg+1))
+       {
+         zlog_warn ("OSPF does not support 'set metric +/-'");
+         arg++;
+       }
+      else
+       {
+         return NULL;
+       }
+    }
   metric = XCALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (u_int32_t));
   ret = atoi (arg);
 
index 0148316296a9f9687d10a87afaf0a26bec98432e..71ba8e9ea72b84f5f3ab55fa02731a32346f14f1 100644 (file)
@@ -592,6 +592,7 @@ ospf_nexthop_calculation (struct ospf_area *area, struct vertex *v,
           if (l->m[0].type == LSA_LINK_TYPE_POINTOPOINT)
             {
              struct in_addr nexthop;
+             nexthop.s_addr = 0;
 
               /* If the destination is a router which connects to
                  the calculating router via a Point-to-MultiPoint
index 1f04cc36bb4b1263bd3c178da7c8ba485c3b04d4..4a31c9a9a6719933874378a9e1910f4436b2ea0b 100644 (file)
@@ -383,9 +383,6 @@ ospf_zebra_add (struct prefix_ipv4 *p, struct ospf_route *or)
   struct stream *s;
   struct ospf_path *path;
   struct listnode *node;
-#ifdef HAVE_NETLINK
-  int ol_cnt = 0, not_ol_cnt = 0;
-#endif /* HAVE_NETLINK */
   struct ospf *ospf = ospf_lookup ();
 
   if (redist_check_instance(&zclient->redist[AFI_IP][ZEBRA_ROUTE_OSPF], ospf->instance))
index ff9a82c37afbaa5b3886a76a8b3e6ee1b44cc631..721d389509e049ad4c5bc7ed163993779308af9a 100644 (file)
@@ -498,7 +498,7 @@ ospf_finish_final (struct ospf *ospf)
   struct ospf_vl_data *vl_data;
   struct listnode *node, *nnode;
   int i;
-  u_short instance;
+  u_short instance = 0;
 
 #ifdef HAVE_OPAQUE_LSA
   ospf_opaque_type11_lsa_term (ospf);