]> git.puffer.fish Git - mirror/frr.git/commitdiff
Many warning fixes from PC Drew ([quagga-dev 940]) and removing using PAGER
authorhasso <hasso>
Thu, 4 Mar 2004 17:45:00 +0000 (17:45 +0000)
committerhasso <hasso>
Thu, 4 Mar 2004 17:45:00 +0000 (17:45 +0000)
from vtysh ([quagga-dev 932]).

15 files changed:
ChangeLog
bgpd/bgp_nexthop.c
lib/debug.c
lib/keychain.c
ospf6d/ospf6_damp.c
ospf6d/ospf6_main.c
ospfd/ospf_abr.c
ospfd/ospf_flood.c
ospfd/ospf_route.c
ospfd/ospf_spf.c
vtysh/ChangeLog
vtysh/vtysh.c
zebra/rt_socket.c
zebra/rtadv.c
zebra/zserv.c

index c24932840dc25a4c7d79487233895ad3ea8fce95..b90f093c7746b9e751e94e2332e0c98f23582d71 100644 (file)
--- a/ChangeLog
+++ b/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.
index 3b91373b9aa0aae5a18def83419111f11d92b11f..4f43b9d14e7ee69a506b331afcd87be9880c84b8 100644 (file)
@@ -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);
        }
index c4b67a52abc9c535524b7eecd8b71d0dbb350965..252e4dd7248f7e363ffc3bbdce2540f5b205198f 100644 (file)
@@ -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);
 }
index dbf431a440fce24bf3f17226d81916b26dd252b1..527da05312963a688cbb6c3b81fd3154bc7724d4 100644 (file)
@@ -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);
index 878c48f609c58693ace850adc88d8c8c51cd530e..40cf798d1dd02e37affd3dff7b2178644ab538e9 100644 (file)
@@ -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;
     }
index be46f3fee3a03a9bcfce6984bf649e87e225fb90..f0a23ebc237b978cb1b609781e971277bfdeaaaf 100644 (file)
@@ -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;
index bacae917855b24db4b26af11fbd6a5f1a90fe19a..424d1d3151c46997b8033516b740eed01521fda2 100644 (file)
@@ -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);
                  }
              }
          }
index 05fcacda36d4da3c3f7b2590f8eb9587914c532d..22611d8dd9674fd901493abf963cadb942c4fe1a 100644 (file)
@@ -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;
index c1c11f190827855f006a84f9da1e296664d8c681..9889d6be5cc0c3cb3181e85e29381e8c5547fb6d 100644 (file)
@@ -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)
index 8399e18e8b1ac7f2ce635162fc7f27b268d7fe87..5ced71ca16ae6cfd86ebeee3460206e12cc218c3 100644 (file)
@@ -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);
 }
index 55421da5a50a179b518559e1239b47514df59498..f4bf93414edb93b15ffb9970d6b7fea0030bee4f 100644 (file)
@@ -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.
index 36b7c5858f64cdb0444a545975913060e4c4fbd5..c92c6c46def608486f6cea6aaefec1677b69b9fb 100644 (file)
@@ -349,8 +349,6 @@ void
 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;
        }
 
index d603c60da3a5c533a8e774f282247d9e368e436c..5b2a5e716641430fe5ab357d0365ae2c34237c30 100644 (file)
@@ -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;
index 61abd95d110d2c0f548246b25ea03624fb901f2b..c98b11cf162fda0fa1ba848375a7118507217d0b 100644 (file)
@@ -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 
index 0f30a559bd1b2b890235a00906065d5971200130..833b369dc57815703285d202ed806588658293b8 100644 (file)
@@ -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++;
          }