summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhasso <hasso>2004-09-26 16:09:34 +0000
committerhasso <hasso>2004-09-26 16:09:34 +0000
commitc9e52be3f4d98943b67fbbe5d9a7ccd823b88326 (patch)
treed4045a946af3be8bbdc303162778e8c44057e2f9
parente473b032b860444b9656cee1654b0120f77b52b1 (diff)
Compiler warnings fixes.
-rw-r--r--bgpd/ChangeLog4
-rw-r--r--bgpd/bgp_aspath.c2
-rw-r--r--bgpd/bgp_packet.c2
-rw-r--r--bgpd/bgp_vty.c2
-rw-r--r--ospfd/ChangeLog5
-rw-r--r--ospfd/ospf_abr.c2
-rw-r--r--ospfd/ospf_dump.c2
-rw-r--r--ospfd/ospf_lsa.c2
-rw-r--r--ospfd/ospf_packet.c2
-rw-r--r--ospfd/ospf_vty.c18
-rw-r--r--ospfd/ospf_zebra.c2
-rw-r--r--ripngd/ChangeLog6
-rw-r--r--ripngd/ripng_nexthop.c6
-rw-r--r--ripngd/ripngd.c18
-rw-r--r--zebra/ChangeLog5
-rw-r--r--zebra/irdp_interface.c2
-rw-r--r--zebra/irdp_main.c1
-rw-r--r--zebra/irdp_packet.c2
-rw-r--r--zebra/rt_netlink.c2
-rw-r--r--zebra/rtadv.c2
-rw-r--r--zebra/zebra_vty.c2
21 files changed, 58 insertions, 31 deletions
diff --git a/bgpd/ChangeLog b/bgpd/ChangeLog
index ee0b3113..2bcce1c7 100644
--- a/bgpd/ChangeLog
+++ b/bgpd/ChangeLog
@@ -1,3 +1,7 @@
+2004-09-26 Hasso Tepper <hasso at quagga.net>
+
+ * bgp_aspath.c, bgp_packet.c, bgp_vty.c: Fix compiler warnings.
+
2004-09-23 Hasso Tepper <hasso at quagga.net>
* *.[c|h]: list -> struct list *, listnode -> struct listnode *.
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c
index d30ef4cc..bcb8f16f 100644
--- a/bgpd/bgp_aspath.c
+++ b/bgpd/bgp_aspath.c
@@ -136,7 +136,7 @@ aspath_make_str_count (struct aspath *as)
struct assegment *assegment;
int str_size = ASPATH_STR_DEFAULT_LEN;
int str_pnt;
- u_char *str_buf;
+ char *str_buf;
int count = 0;
/* Empty aspath. */
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index 42820273..b4cd1301 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -2253,7 +2253,7 @@ bgp_read (struct thread *thread)
bgp_notify_send_with_data (peer,
BGP_NOTIFY_HEADER_ERR,
BGP_NOTIFY_HEADER_BAD_MESLEN,
- notify_data_length, 2);
+ (u_char *) notify_data_length, 2);
goto done;
}
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 92918bdf..27a3c2eb 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -2584,7 +2584,7 @@ DEFUN (neighbor_description,
b = buffer_new (1024);
for (i = 1; i < argc; i++)
{
- buffer_putstr (b, (u_char *)argv[i]);
+ buffer_putstr (b, argv[i]);
buffer_putc (b, ' ');
}
buffer_putc (b, '\0');
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog
index 53ae8f29..8423cab0 100644
--- a/ospfd/ChangeLog
+++ b/ospfd/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-26 Hasso Tepper <hasso at quagga.net>
+
+ * ospf_abr.c, ospf_dump.c, ospf_lsa.c, ospf_packet.c, ospf_vty.c,
+ ospf_zebra.c: Fix compiler warnings.
+
2004-09-24 Paul Jakma <paul@dishone.st>
* ospf_apiserver.{c,h}: lists typedef removal cleanup.
diff --git a/ospfd/ospf_abr.c b/ospfd/ospf_abr.c
index 9f3a587c..e23ace20 100644
--- a/ospfd/ospf_abr.c
+++ b/ospfd/ospf_abr.c
@@ -596,7 +596,7 @@ set_metric (struct ospf_lsa *lsa, u_int32_t metric)
struct summary_lsa *header;
u_char *mp;
metric = htonl (metric);
- mp = (char *) &metric;
+ mp = (u_char *) &metric;
mp++;
header = (struct summary_lsa *) lsa->data;
memcpy(header->metric, mp, 3);
diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c
index 3711e9f0..958baa40 100644
--- a/ospfd/ospf_dump.c
+++ b/ospfd/ospf_dump.c
@@ -649,7 +649,7 @@ ospf_header_dump (struct ospf_header *ospfh)
break;
case OSPF_AUTH_SIMPLE:
memset (buf, 0, 9);
- strncpy (buf, ospfh->u.auth_data, 8);
+ strncpy (buf, (char *) ospfh->u.auth_data, 8);
zlog_info (" Simple Password %s", buf);
break;
case OSPF_AUTH_CRYPTOGRAPHIC:
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index 34d71b6c..944af64d 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -186,7 +186,7 @@ ospf_lsa_checksum (struct lsa_header *lsa)
lsa->checksum = 0;
length = ntohs (lsa->length) - 2;
- sp = (char *) &lsa->options;
+ sp = (u_char *) &lsa->options;
for (ep = sp + length; sp < ep; sp = q)
{
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 5952d184..67926fc3 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -351,7 +351,7 @@ ospf_make_md5_digest (struct ospf_interface *oi, struct ospf_packet *op)
else
{
ck = getdata (OSPF_IF_PARAM (oi, auth_crypt)->tail);
- auth_key = ck->auth_key;
+ auth_key = (char *) ck->auth_key;
}
/* Generate a digest for the entire packet + our secret key. */
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 6b0dabbd..ab73f7b1 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -718,7 +718,7 @@ ospf_vl_set_security (struct ospf_vl_data *vl_data,
if (vl_config->auth_key)
{
memset(IF_DEF_PARAMS (ifp)->auth_simple, 0, OSPF_AUTH_SIMPLE_SIZE+1);
- strncpy (IF_DEF_PARAMS (ifp)->auth_simple, vl_config->auth_key,
+ strncpy ((char *) IF_DEF_PARAMS (ifp)->auth_simple, vl_config->auth_key,
OSPF_AUTH_SIMPLE_SIZE);
}
else if (vl_config->md5_key)
@@ -733,7 +733,7 @@ ospf_vl_set_security (struct ospf_vl_data *vl_data,
ck = ospf_crypt_key_new ();
ck->key_id = vl_config->crypto_key_id;
memset(ck->auth_key, 0, OSPF_AUTH_MD5_SIZE+1);
- strncpy (ck->auth_key, vl_config->md5_key, OSPF_AUTH_MD5_SIZE);
+ strncpy ((char *) ck->auth_key, vl_config->md5_key, OSPF_AUTH_MD5_SIZE);
ospf_crypt_key_add (IF_DEF_PARAMS (ifp)->auth_crypt, ck);
}
@@ -4130,7 +4130,7 @@ DEFUN (ip_ospf_authentication_key,
memset (params->auth_simple, 0, OSPF_AUTH_SIMPLE_SIZE + 1);
- strncpy (params->auth_simple, argv[0], OSPF_AUTH_SIMPLE_SIZE);
+ strncpy ((char *) params->auth_simple, argv[0], OSPF_AUTH_SIMPLE_SIZE);
SET_IF_PARAM (params, auth_simple);
return CMD_SUCCESS;
@@ -4255,7 +4255,7 @@ DEFUN (ip_ospf_message_digest_key,
ck = ospf_crypt_key_new ();
ck->key_id = (u_char) key_id;
memset (ck->auth_key, 0, OSPF_AUTH_MD5_SIZE+1);
- strncpy (ck->auth_key, argv[1], OSPF_AUTH_MD5_SIZE);
+ strncpy ((char *) ck->auth_key, argv[1], OSPF_AUTH_MD5_SIZE);
ospf_crypt_key_add (params->auth_crypt, ck);
SET_IF_PARAM (params, auth_crypt);
@@ -6882,9 +6882,9 @@ config_write_network_area (struct vty *vty, struct ospf *ospf)
/* Create Area ID string by specified Area ID format. */
if (n->format == OSPF_AREA_ID_FORMAT_ADDRESS)
- strncpy (buf, inet_ntoa (n->area_id), INET_ADDRSTRLEN);
+ strncpy ((char *) buf, inet_ntoa (n->area_id), INET_ADDRSTRLEN);
else
- sprintf (buf, "%lu",
+ sprintf ((char *) buf, "%lu",
(unsigned long int) ntohl (n->area_id.s_addr));
/* Network print. */
@@ -6908,7 +6908,7 @@ config_write_ospf_area (struct vty *vty, struct ospf *ospf)
struct ospf_area *area = getdata (node);
struct route_node *rn1;
- area_id2str (buf, INET_ADDRSTRLEN, area);
+ area_id2str ((char *) buf, INET_ADDRSTRLEN, area);
if (area->auth_type != OSPF_AUTH_NULL)
{
@@ -7041,9 +7041,9 @@ config_write_virtual_link (struct vty *vty, struct ospf *ospf)
memset (buf, 0, INET_ADDRSTRLEN);
if (vl_data->format == OSPF_AREA_ID_FORMAT_ADDRESS)
- strncpy (buf, inet_ntoa (vl_data->vl_area_id), INET_ADDRSTRLEN);
+ strncpy ((char *) buf, inet_ntoa (vl_data->vl_area_id), INET_ADDRSTRLEN);
else
- sprintf (buf, "%lu",
+ sprintf ((char *) buf, "%lu",
(unsigned long int) ntohl (vl_data->vl_area_id.s_addr));
oi = vl_data->vl_oi;
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index 5520c089..6a675a59 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -139,7 +139,7 @@ zebra_interface_if_lookup (struct stream *s)
stream_get (ifname_tmp, s, INTERFACE_NAMSIZ);
/* Lookup this by interface index. */
- ifp = if_lookup_by_name (ifname_tmp);
+ ifp = if_lookup_by_name ((char *) ifname_tmp);
/* If such interface does not exist, indicate an error */
if (!ifp)
diff --git a/ripngd/ChangeLog b/ripngd/ChangeLog
index 92dbf6f6..112aa192 100644
--- a/ripngd/ChangeLog
+++ b/ripngd/ChangeLog
@@ -1,3 +1,9 @@
+2004-09-26 Hasso Tepper <hasso at quagga.net>
+
+ * ripingd.c: Access list hook argument function must have struct
+ access_list * argument. Solution taken from ripd.
+ * ripngd.c, ripnf_nexthop.c: Fix compiler warnings.
+
2004-09-23 Hasso Tepper <hasso at quagga.net>
* *.[c|h]: list -> struct list *, listnode -> struct listnode *.
diff --git a/ripngd/ripng_nexthop.c b/ripngd/ripng_nexthop.c
index 04b13c50..e946dc91 100644
--- a/ripngd/ripng_nexthop.c
+++ b/ripngd/ripng_nexthop.c
@@ -161,7 +161,7 @@ ripng_rte_send(struct list *ripng_rte_list, struct interface *ifp,
/* A nexthop entry should be at least followed by 1 RTE */
if (num == (rtemax-1)) {
- ret = ripng_send_packet (STREAM_DATA (s), stream_get_endp (s),
+ ret = ripng_send_packet ((caddr_t) STREAM_DATA (s), stream_get_endp (s),
to, ifp);
if (ret >= 0 && IS_RIPNG_DEBUG_SEND)
@@ -191,7 +191,7 @@ ripng_rte_send(struct list *ripng_rte_list, struct interface *ifp,
TAG_OUT(data), METRIC_OUT(data));
if (num == rtemax) {
- ret = ripng_send_packet (STREAM_DATA (s), stream_get_endp (s),
+ ret = ripng_send_packet ((caddr_t) STREAM_DATA (s), stream_get_endp (s),
to, ifp);
if (ret >= 0 && IS_RIPNG_DEBUG_SEND)
@@ -204,7 +204,7 @@ ripng_rte_send(struct list *ripng_rte_list, struct interface *ifp,
/* If unwritten RTE exist, flush it. */
if (num != 0) {
- ret = ripng_send_packet (STREAM_DATA (s), stream_get_endp (s),
+ ret = ripng_send_packet ((caddr_t) STREAM_DATA (s), stream_get_endp (s),
to, ifp);
if (ret >= 0 && IS_RIPNG_DEBUG_SEND)
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index 874848c9..4d7c0216 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -1585,9 +1585,9 @@ ripng_write_rte (int num, struct stream *s, struct prefix_ipv6 *p,
/* Write routing table entry. */
if (!nexthop)
- stream_write (s, (caddr_t) &p->prefix, sizeof (struct in6_addr));
+ stream_write (s, (u_char *) &p->prefix, sizeof (struct in6_addr));
else
- stream_write (s, (caddr_t) nexthop, sizeof (struct in6_addr));
+ stream_write (s, (u_char *) nexthop, sizeof (struct in6_addr));
stream_putw (s, tag);
if (p)
stream_putc (s, p->prefixlen);
@@ -2813,7 +2813,7 @@ ripng_distribute_update_interface (struct interface *ifp)
/* Update all interface's distribute list. */
void
-ripng_distribute_update_all ()
+ripng_distribute_update_all (struct prefix_list *notused)
{
struct interface *ifp;
struct listnode *node;
@@ -2824,6 +2824,12 @@ ripng_distribute_update_all ()
ripng_distribute_update_interface (ifp);
}
}
+
+void
+ripng_distribute_update_all_wrapper (struct access_list *notused)
+{
+ ripng_distribute_update_all(NULL);
+}
/* delete all the added ripng routes. */
void
@@ -2985,7 +2991,7 @@ ripng_routemap_update_redistribute (void)
}
void
-ripng_routemap_update ()
+ripng_routemap_update (char *unused)
{
struct interface *ifp;
struct listnode *node;
@@ -3049,8 +3055,8 @@ ripng_init ()
/* Access list install. */
access_list_init ();
- access_list_add_hook (ripng_distribute_update_all);
- access_list_delete_hook (ripng_distribute_update_all);
+ access_list_add_hook (ripng_distribute_update_all_wrapper);
+ access_list_delete_hook (ripng_distribute_update_all_wrapper);
/* Prefix list initialize.*/
prefix_list_init ();
diff --git a/zebra/ChangeLog b/zebra/ChangeLog
index 27deda70..a62fb6cc 100644
--- a/zebra/ChangeLog
+++ b/zebra/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-26 Hasso Tepper <hasso at quagga.net>
+
+ * irdp_interface.c, irdp_main.c, irdp_packet.c, rt_netlink.c,
+ rtadv.c, zebra_vty.c: Fix compiler warnings.
+
2004-09-24 Paul Jakma <paul@dishone.st>
* irdp_interface.c: (no_ip_irdp_address_preference_cmd)
diff --git a/zebra/irdp_interface.c b/zebra/irdp_interface.c
index 9aace8c4..76654c47 100644
--- a/zebra/irdp_interface.c
+++ b/zebra/irdp_interface.c
@@ -245,7 +245,7 @@ void irdp_if_start(struct interface *ifp, int multicast, int set_defaults)
timer = (random () % IRDP_DEFAULT_INTERVAL) + 1;
irdp->AdvPrefList = list_new();
- irdp->AdvPrefList->del = (void *) Adv_free; /* Destructor */
+ irdp->AdvPrefList->del = (void (*)(void *)) Adv_free; /* Destructor */
/* And this for startup. Speed limit from 1991 :-). But it's OK*/
diff --git a/zebra/irdp_main.c b/zebra/irdp_main.c
index 9e31950e..5ee50e79 100644
--- a/zebra/irdp_main.c
+++ b/zebra/irdp_main.c
@@ -41,6 +41,7 @@
#include "if.h"
#include "vty.h"
#include "sockunion.h"
+#include "sockopt.h"
#include "prefix.h"
#include "command.h"
#include "memory.h"
diff --git a/zebra/irdp_packet.c b/zebra/irdp_packet.c
index bb3513a3..67609b31 100644
--- a/zebra/irdp_packet.c
+++ b/zebra/irdp_packet.c
@@ -227,7 +227,7 @@ int irdp_read_raw(struct thread *r)
int irdp_sock = THREAD_FD (r);
t_irdp_raw = thread_add_read (zebrad.master, irdp_read_raw, NULL, irdp_sock);
- ret = irdp_recvmsg (irdp_sock, buf, IRDP_RX_BUF, &ifindex);
+ ret = irdp_recvmsg (irdp_sock, (u_char *) buf, IRDP_RX_BUF, &ifindex);
if (ret < 0) zlog_warn ("IRDP: RX Error length = %d", ret);
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 9e6c440b..cb69187c 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -179,7 +179,7 @@ netlink_socket (struct nlsock *nl, unsigned long groups)
/* multiple netlink sockets will have different nl_pid */
namelen = sizeof snl;
- ret = getsockname (sock, (struct sockaddr *) &snl, &namelen);
+ ret = getsockname (sock, (struct sockaddr *) &snl, (socklen_t *) &namelen);
if (ret < 0 || namelen != sizeof snl)
{
zlog (NULL, LOG_ERR, "Can't get %s socket name: %s", nl->name,
diff --git a/zebra/rtadv.c b/zebra/rtadv.c
index 4bab03bf..e5a026e6 100644
--- a/zebra/rtadv.c
+++ b/zebra/rtadv.c
@@ -1110,7 +1110,7 @@ rtadv_config_write (struct vty *vty, struct interface *ifp)
rprefix = getdata (node);
vty_out (vty, " ipv6 nd prefix %s/%d",
inet_ntop (AF_INET6, &rprefix->prefix.u.prefix6,
- buf, INET6_ADDRSTRLEN),
+ (char *) buf, INET6_ADDRSTRLEN),
rprefix->prefix.prefixlen);
if ((rprefix->AdvValidLifetime != RTADV_VALID_LIFETIME) ||
(rprefix->AdvPreferredLifetime != RTADV_PREFERRED_LIFETIME))
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 4bcd29f7..b2f09325 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -59,7 +59,7 @@ route_type_str (u_char type)
};
/* Return route type string for VTY output. */
-const char
+char
route_type_char (u_char type)
{
switch (type)