Many warning fixes from PC Drew ([quagga-dev 940]) and removing using PAGER
from vtysh ([quagga-dev 932]).
diff --git a/ChangeLog b/ChangeLog
index c249328..b90f093 100644
--- 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.
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c
index 3b91373..4f43b9d 100644
--- a/bgpd/bgp_nexthop.c
+++ b/bgpd/bgp_nexthop.c
@@ -153,6 +153,9 @@
return 0;
break;
#endif /* HAVE_IPV6 */
+ default:
+ /* do nothing */
+ break;
}
return 1;
}
@@ -882,6 +885,9 @@
case ZEBRA_NEXTHOP_IFNAME:
nexthop->ifindex = stream_getl (s);
break;
+ default:
+ /* do nothing */
+ break;
}
bnc_nexthop_add (bnc, nexthop);
}
@@ -982,6 +988,9 @@
case ZEBRA_NEXTHOP_IFNAME:
nexthop->ifindex = stream_getl (s);
break;
+ default:
+ /* do nothing */
+ break;
}
bnc_nexthop_add (bnc, nexthop);
}
diff --git a/lib/debug.c b/lib/debug.c
index c4b67a5..252e4dd 100644
--- a/lib/debug.c
+++ b/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 @@
printf ("%s\n", strings[i]);
free (strings);
+#endif /* HAVE_GLIBC_BACKTRACE */
exit(1);
}
diff --git a/lib/keychain.c b/lib/keychain.c
index dbf431a..527da05 100644
--- a/lib/keychain.c
+++ b/lib/keychain.c
@@ -921,7 +921,7 @@
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 @@
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);
diff --git a/ospf6d/ospf6_damp.c b/ospf6d/ospf6_damp.c
index 878c48f..40cf798 100644
--- a/ospf6d/ospf6_damp.c
+++ b/ospf6d/ospf6_damp.c
@@ -279,7 +279,7 @@
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 @@
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 @@
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 @@
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;
}
diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c
index be46f3f..f0a23eb 100644
--- a/ospf6d/ospf6_main.c
+++ b/ospf6d/ospf6_main.c
@@ -97,7 +97,13 @@
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;
diff --git a/ospfd/ospf_abr.c b/ospfd/ospf_abr.c
index bacae91..424d1d3 100644
--- a/ospfd/ospf_abr.c
+++ b/ospfd/ospf_abr.c
@@ -1078,7 +1078,7 @@
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 @@
" 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);
}
}
}
diff --git a/ospfd/ospf_flood.c b/ospfd/ospf_flood.c
index 05fcacd..22611d8 100644
--- a/ospfd/ospf_flood.c
+++ b/ospfd/ospf_flood.c
@@ -355,7 +355,6 @@
struct ospf_neighbor *inbr,
struct ospf_lsa *lsa)
{
- struct ospf *ospf = oi->ospf;
struct ospf_neighbor *onbr;
struct route_node *rn;
int retx_flag;
diff --git a/ospfd/ospf_route.c b/ospfd/ospf_route.c
index c1c11f1..9889d6b 100644
--- a/ospfd/ospf_route.c
+++ b/ospfd/ospf_route.c
@@ -192,8 +192,8 @@
{
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)
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c
index 8399e18..5ced71c 100644
--- a/ospfd/ospf_spf.c
+++ b/ospfd/ospf_spf.c
@@ -1132,7 +1132,7 @@
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);
}
diff --git a/vtysh/ChangeLog b/vtysh/ChangeLog
index 55421da..f4bf934 100644
--- a/vtysh/ChangeLog
+++ b/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.
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 36b7c58..c92c6c4 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -350,8 +350,6 @@
{
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 @@
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;
}
diff --git a/zebra/rt_socket.c b/zebra/rt_socket.c
index d603c60..5b2a5e7 100644
--- a/zebra/rt_socket.c
+++ b/zebra/rt_socket.c
@@ -71,7 +71,7 @@
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;
diff --git a/zebra/rtadv.c b/zebra/rtadv.c
index 61abd95..c98b11c 100644
--- a/zebra/rtadv.c
+++ b/zebra/rtadv.c
@@ -41,6 +41,10 @@
#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
diff --git a/zebra/zserv.c b/zebra/zserv.c
index 0f30a55..833b369 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -862,6 +862,9 @@
case ZEBRA_NEXTHOP_IFNAME:
stream_putl (s, nexthop->ifindex);
break;
+ default:
+ /* do nothing */
+ break;
}
num++;
}
@@ -921,6 +924,9 @@
case ZEBRA_NEXTHOP_IFNAME:
stream_putl (s, nexthop->ifindex);
break;
+ default:
+ /* do nothing */
+ break;
}
num++;
}
@@ -979,6 +985,9 @@
case ZEBRA_NEXTHOP_IFNAME:
stream_putl (s, nexthop->ifindex);
break;
+ default:
+ /* do nothing */
+ break;
}
num++;
}