Compiler warnings fixes.
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog
index 53ae8f2..8423cab 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 9f3a587..e23ace2 100644
--- a/ospfd/ospf_abr.c
+++ b/ospfd/ospf_abr.c
@@ -596,7 +596,7 @@
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 3711e9f..958baa4 100644
--- a/ospfd/ospf_dump.c
+++ b/ospfd/ospf_dump.c
@@ -649,7 +649,7 @@
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 34d71b6..944af64 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -186,7 +186,7 @@
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 5952d18..67926fc 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -351,7 +351,7 @@
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 6b0dabb..ab73f7b 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -718,7 +718,7 @@
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 @@
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 @@
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 @@
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 @@
/* 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 @@
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 @@
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 5520c08..6a675a5 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -139,7 +139,7 @@
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)