From c9e52be3f4d98943b67fbbe5d9a7ccd823b88326 Mon Sep 17 00:00:00 2001 From: hasso Date: Sun, 26 Sep 2004 16:09:34 +0000 Subject: Compiler warnings fixes. --- ospfd/ChangeLog | 5 +++++ ospfd/ospf_abr.c | 2 +- ospfd/ospf_dump.c | 2 +- ospfd/ospf_lsa.c | 2 +- ospfd/ospf_packet.c | 2 +- ospfd/ospf_vty.c | 18 +++++++++--------- ospfd/ospf_zebra.c | 2 +- 7 files changed, 19 insertions(+), 14 deletions(-) (limited to 'ospfd') 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 + + * 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 * 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) -- cgit v1.2.1