Browse Source

Many warning fixes from PC Drew ([quagga-dev 940]) and removing using PAGER
from vtysh ([quagga-dev 932]).

hasso 17 years ago
parent
commit
fa2b17e394
15 changed files with 79 additions and 18 deletions
  1. 30 0
      ChangeLog
  2. 9 0
      bgpd/bgp_nexthop.c
  3. 2 0
      lib/debug.c
  4. 2 2
      lib/keychain.c
  5. 4 4
      ospf6d/ospf6_damp.c
  6. 6 0
      ospf6d/ospf6_main.c
  7. 2 2
      ospfd/ospf_abr.c
  8. 0 1
      ospfd/ospf_flood.c
  9. 2 2
      ospfd/ospf_route.c
  10. 1 1
      ospfd/ospf_spf.c
  11. 4 0
      vtysh/ChangeLog
  12. 3 5
      vtysh/vtysh.c
  13. 1 1
      zebra/rt_socket.c
  14. 4 0
      zebra/rtadv.c
  15. 9 0
      zebra/zserv.c

+ 30 - 0
ChangeLog

@@ -1,3 +1,33 @@
+2004-03-03 PC Drew <pc@superiorcomm.net>
+
+	* lib/keychain.c: typecast time_t function to long, fixes compile
+	  warning.
+	* lib/debug.c: wrapped function with ifdef HAVE_GLIBC_BACKTRACE fixes
+	  compile warning when backtrace doesn't exist for that system.
+	* zebra/rtadv.c: for OpenBSD, added include statement for
+	  netinet/icmp6.h
+	* zebra/zserv.c: added default case to switch statements, fixes compile
+	  warning about certain NEXTHOP_TYPE enumeration values not being
+	  handled.
+	* zebra/rt_socket.c: set *mask = NULL by default, fixes compile
+	  warning, about mask possibly being used uninitialized.
+	* bgpd/bgp_nexthop.c: added default case to switch statements, fixes
+	  compile warning about certain NEXTHOP_TYPE enumeration values not
+	  being handled.
+	* ospfd/ospf_spf.c: typecast time_t to long, fixes compile warning.
+	* ospfd/ospf_route.c: typecast route_node->prefix to prefix_ipv4, fixes
+	  compile warning.
+	* ospfd/ospf_route.c: typecast prefix_ipv4 to prefix, fixes compile
+	  warning.
+	* ospfd/ospf_abr.c: typecast prefix to prefix_ipv4 in two instances,
+	  fixes compile warning.
+	* vtysh/vtysh.c: fixed null pointer sentinel value when doing execl and
+	  friends, fixes compile warning.
+	* ospf6d/ospf6_damp.c: typecast time_t to long in 4 instances, fixes
+	  compile warning.
+	* ospf6d/ospf6_main.c: use MAXPATHLEN (if set) instead of 64 for the
+	  _cwd array, fixes compile warning.
+
 2004-01-19 Paul Jakma <paul@dishone.st>
 
 	* tests/test-sig.c: New file, regression test for sigevents.

+ 9 - 0
bgpd/bgp_nexthop.c

@@ -153,6 +153,9 @@ bgp_nexthop_same (struct nexthop *next1, struct nexthop *next2)
 	return 0;
       break;
 #endif /* HAVE_IPV6 */
+    default:
+      /* do nothing */
+      break;
     }
   return 1;
 }
@@ -882,6 +885,9 @@ zlookup_read ()
 	    case ZEBRA_NEXTHOP_IFNAME:
 	      nexthop->ifindex = stream_getl (s);
 	      break;
+            default:
+              /* do nothing */
+              break;
 	    }
 	  bnc_nexthop_add (bnc, nexthop);
 	}
@@ -982,6 +988,9 @@ zlookup_read_ipv6 ()
 	    case ZEBRA_NEXTHOP_IFNAME:
 	      nexthop->ifindex = stream_getl (s);
 	      break;
+	    default:
+	      /* do nothing */
+	      break;
 	    }
 	  bnc_nexthop_add (bnc, nexthop);
 	}

+ 2 - 0
lib/debug.c

@@ -4,6 +4,7 @@
 void 
 debug_print_trace (int signal)
 {
+#ifdef HAVE_GLIBC_BACKTRACE
     void *array[10];
     size_t size;
     char **strings;   
@@ -18,6 +19,7 @@ debug_print_trace (int signal)
       printf ("%s\n", strings[i]);
 
     free (strings);
+#endif /* HAVE_GLIBC_BACKTRACE */
     
     exit(1);
 }

+ 2 - 2
lib/keychain.c

@@ -921,7 +921,7 @@ keychain_config_write (struct vty *vty)
 		vty_out (vty, " infinite");
 	      else if (key->accept.duration)
 		vty_out (vty, " duration %ld",
-			 key->accept.end - key->accept.start);
+			 (long)(key->accept.end - key->accept.start));
 	      else
 		{
 		  keychain_strftime (buf, BUFSIZ, &key->accept.end);
@@ -938,7 +938,7 @@ keychain_config_write (struct vty *vty)
 	      if (key->send.end == -1)
 		vty_out (vty, " infinite");
 	      else if (key->send.duration)
-		vty_out (vty, " duration %ld", key->send.end - key->send.start);
+		vty_out (vty, " duration %ld", (long)(key->send.end - key->send.start));
 	      else
 		{
 		  keychain_strftime (buf, BUFSIZ, &key->send.end);

+ 4 - 4
ospf6d/ospf6_damp.c

@@ -279,7 +279,7 @@ ospf6_damp_stop (struct ospf6_damp_info *di)
       gettimeofday (&now, NULL);
       zlog_info ("DAMP: %lu.%06lu stop damping: %ld: type: %d, name: %s",
                  now.tv_sec, now.tv_usec,
-                 t_now, di->type, namebuf);
+                 (long)t_now, di->type, namebuf);
     }
 
   /* set flag indicates that we're damping this target */
@@ -435,7 +435,7 @@ ospf6_damp_event (damp_event_t event_type,
           gettimeofday (&now, NULL);
           zlog_info ("DAMP: %lu.%06lu stop damping: %ld: type: %d, name: %s",
                      now.tv_sec, now.tv_usec,
-                     t_now, di->type, namebuf);
+                     (long)t_now, di->type, namebuf);
         }
       di->damping = OFF;
     }
@@ -450,7 +450,7 @@ ospf6_damp_event (damp_event_t event_type,
           gettimeofday (&now, NULL);
           zlog_info ("DAMP: %lu.%06lu start damping: %ld: type: %d, name: %s",
                      now.tv_sec, now.tv_usec,
-                     t_now, type, namebuf);
+                     (long)t_now, type, namebuf);
         }
       di->damping = ON;
     }
@@ -471,7 +471,7 @@ ospf6_damp_event (damp_event_t event_type,
           gettimeofday (&now, NULL);
           zlog_info ("DAMP: %lu.%06lu start damping: %ld: type: %d, name: %s",
                      now.tv_sec, now.tv_usec,
-                     t_now, type, namebuf);
+                    (long) t_now, type, namebuf);
         }
       di->damping = ON;
     }

+ 6 - 0
ospf6d/ospf6_main.c

@@ -97,7 +97,13 @@ struct thread_master *master;
 char *pid_file = PATH_OSPF6D_PID;
 
 /* for reload */
+
+#ifdef MAXPATHLEN
+char _cwd[MAXPATHLEN];
+#else
 char _cwd[64];
+#endif
+
 char _progpath[64];
 int _argc;
 char **_argv;

+ 2 - 2
ospfd/ospf_abr.c

@@ -1078,7 +1078,7 @@ ospf_abr_process_network_rt (struct ospf *ospf,
 
       if (IS_DEBUG_OSPF_EVENT)
 	zlog_info ("ospf_abr_process_network_rt(): announcing");
-      ospf_abr_announce_network (ospf, &rn->p, or);
+      ospf_abr_announce_network (ospf, (struct prefix_ipv4 *)&rn->p, or);
     }
 
   if (IS_DEBUG_OSPF_EVENT)
@@ -1474,7 +1474,7 @@ ospf_abr_announce_aggregates (struct ospf *ospf)
 				     " a transit area");
 			continue; 
 		      }
-		    ospf_abr_announce_network_to_area (&p, range->cost, ar);
+		    ospf_abr_announce_network_to_area ((struct prefix_ipv4 *)&p, range->cost, ar);
 		  }
 	      }
 	  }

+ 0 - 1
ospfd/ospf_flood.c

@@ -355,7 +355,6 @@ ospf_flood_through_interface (struct ospf_interface *oi,
 			      struct ospf_neighbor *inbr,
 			      struct ospf_lsa *lsa)
 {
-  struct ospf *ospf = oi->ospf;
   struct ospf_neighbor *onbr;
   struct route_node *rn;
   int retx_flag;

+ 2 - 2
ospfd/ospf_route.c

@@ -192,8 +192,8 @@ ospf_route_delete_same_ext(struct route_table *external_routes,
     {
       if (rn && rn->info)
         {
-          struct prefix_ipv4 *p = &rn->p;
-          if ( (ext_rn = route_node_lookup (external_routes, p)) )
+          struct prefix_ipv4 *p = (struct prefix_ipv4 *)(&rn->p);
+          if ( (ext_rn = route_node_lookup (external_routes, (struct prefix *)p)) )
             {
               ospf_zebra_delete (p, ext_rn->info);
               if (ext_rn->info)

+ 1 - 1
ospfd/ospf_spf.c

@@ -1132,7 +1132,7 @@ ospf_spf_calculate_schedule (struct ospf *ospf)
     delay = ospf->spf_delay;
 
   if (IS_DEBUG_OSPF_EVENT)
-    zlog_info ("SPF: calculation timer delay = %ld", delay);
+    zlog_info ("SPF: calculation timer delay = %ld", (long)delay);
   ospf->t_spf_calc =
     thread_add_timer (master, ospf_spf_calculate_timer, ospf, delay);
 }

+ 4 - 0
vtysh/ChangeLog

@@ -1,3 +1,7 @@
+2004-03-04 Hasso Tepper <hasso@estpak.ee>
+
+	* vtysh.c: Remove using PAGER.
+
 2004-01-15 Paul Jakma <paul@dishone.st>
 
 	* vtysh_config.c: Fix up strlen to use correct string.

+ 3 - 5
vtysh/vtysh.c

@@ -350,8 +350,6 @@ vtysh_pager_init ()
 {
   vtysh_pager_name = getenv ("VTYSH_PAGER");
   if (! vtysh_pager_name)
-    vtysh_pager_name = getenv ("PAGER");
-  if (! vtysh_pager_name)
     vtysh_pager_name = "more";
 }
 
@@ -1465,13 +1463,13 @@ execute_command (char *command, int argc, char *arg1, char *arg2)
       switch (argc)
 	{
 	case 0:
-	  ret = execlp (command, command, NULL);
+	  ret = execlp (command, command, (const char *)NULL);
 	  break;
 	case 1:
-	  ret = execlp (command, command, arg1, NULL);
+	  ret = execlp (command, command, arg1, (const char *)NULL);
 	  break;
 	case 2:
-	  ret = execlp (command, command, arg1, arg2, NULL);
+	  ret = execlp (command, command, arg1, arg2, (const char *)NULL);
 	  break;
 	}
 

+ 1 - 1
zebra/rt_socket.c

@@ -71,7 +71,7 @@ int
 kernel_rtm_ipv4 (int cmd, struct prefix *p, struct rib *rib, int family)
 
 {
-  struct sockaddr_in *mask;
+  struct sockaddr_in *mask = NULL;
   struct sockaddr_in sin_dest, sin_mask, sin_gate;
   struct nexthop *nexthop;
   int nexthop_num = 0;

+ 4 - 0
zebra/rtadv.c

@@ -41,6 +41,10 @@ extern struct zebra_privs_t zserv_privs;
 
 #if defined (HAVE_IPV6) && defined (RTADV)
 
+#ifdef OPEN_BSD
+#include <netinet/icmp6.h>
+#endif
+
 /* If RFC2133 definition is used. */
 #ifndef IPV6_JOIN_GROUP
 #define IPV6_JOIN_GROUP  IPV6_ADD_MEMBERSHIP 

+ 9 - 0
zebra/zserv.c

@@ -862,6 +862,9 @@ zsend_ipv6_nexthop_lookup (struct zserv *client, struct in6_addr *addr)
 	      case ZEBRA_NEXTHOP_IFNAME:
 		stream_putl (s, nexthop->ifindex);
 		break;
+	      default:
+                /* do nothing */
+		break;
 	      }
 	    num++;
 	  }
@@ -921,6 +924,9 @@ zsend_ipv4_nexthop_lookup (struct zserv *client, struct in_addr addr)
 	      case ZEBRA_NEXTHOP_IFNAME:
 		stream_putl (s, nexthop->ifindex);
 		break;
+	      default:
+                /* do nothing */
+		break;
 	      }
 	    num++;
 	  }
@@ -979,6 +985,9 @@ zsend_ipv4_import_lookup (struct zserv *client, struct prefix_ipv4 *p)
 	      case ZEBRA_NEXTHOP_IFNAME:
 		stream_putl (s, nexthop->ifindex);
 		break;
+	      default:
+                /* do nothing */
+		break;
 	      }
 	    num++;
 	  }