]> git.proxmox.com Git - mirror_frr.git/commitdiff
Compiler warnings fixes.
authorhasso <hasso>
Sun, 26 Sep 2004 16:09:34 +0000 (16:09 +0000)
committerhasso <hasso>
Sun, 26 Sep 2004 16:09:34 +0000 (16:09 +0000)
21 files changed:
bgpd/ChangeLog
bgpd/bgp_aspath.c
bgpd/bgp_packet.c
bgpd/bgp_vty.c
ospfd/ChangeLog
ospfd/ospf_abr.c
ospfd/ospf_dump.c
ospfd/ospf_lsa.c
ospfd/ospf_packet.c
ospfd/ospf_vty.c
ospfd/ospf_zebra.c
ripngd/ChangeLog
ripngd/ripng_nexthop.c
ripngd/ripngd.c
zebra/ChangeLog
zebra/irdp_interface.c
zebra/irdp_main.c
zebra/irdp_packet.c
zebra/rt_netlink.c
zebra/rtadv.c
zebra/zebra_vty.c

index ee0b3113f90f9f3081f4e07fd67522976fd1c15a..2bcce1c7b0623ca55a0aa63002752175b31ec842 100644 (file)
@@ -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 *.
index d30ef4cc67cf261769e913425ff54497e68492c2..bcb8f16f29397ae346b4753617ab85009fd7d514 100644 (file)
@@ -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. */
index 42820273f4800150cd5eb6c7d6f781191847ca34..b4cd1301610e5a1d24668e44def70d410e1a74c0 100644 (file)
@@ -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;
        }
 
index 92918bdfcf5057e9de18f1fa5f10381f2fcd2a1f..27a3c2eb53b124ce4da01c762922663b405944c3 100644 (file)
@@ -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');
index 53ae8f29dbcc26be7c35ecb3fb0e1154dc2a0ed5..8423cab051ddcd84fdaa04f2eed7c611ccb6a146 100644 (file)
@@ -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.
index 9f3a587cb43376156b9bcdeb4b15949a01c230fe..e23ace2058beb2f030f15400e3c7fe0360bf4058 100644 (file)
@@ -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);
index 3711e9f0f9d80bae50cab74b02b727e851540676..958baa40bb220f2a1b8a3d4a14685dcf100d03c9 100644 (file)
@@ -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:
index 34d71b6c9f671a836bd4bc0e23f1884ba66f8660..944af64d8fb5b5d7fb783050aa766072080f2b8c 100644 (file)
@@ -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)
     {
index 5952d184e13b32ceb577c07dc73acc67768398c9..67926fc34bc7216fe2dfb0db8e0f2f729e41b711 100644 (file)
@@ -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. */
index 6b0dabbd46169cb261b763cd5915c5c5845f30be..ab73f7b132fd0511fa93a5a693b953203c53d8f3 100644 (file)
@@ -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;
 
index 5520c0895474343cd8da3eb687f30ce5e9ddb55a..6a675a599f49fe2ee9384bac862b6d07a807557c 100644 (file)
@@ -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)
index 92dbf6f674426506abf0b4725a242c2aa73c0196..112aa192188e3684ccb4a383803e4305743df410 100644 (file)
@@ -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 *.
index 04b13c50dd9bc9a231c941a04ec9a5ce2311c3c2..e946dc9127f5fd55e77b86c1212285981190d0d9 100644 (file)
@@ -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)
index 874848c9512d41e5a41ed9107e3592710589c460..4d7c0216e4f731384a1027e63dd6d599d605e5af 100644 (file)
@@ -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);
+}
 \f
 /* 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 ();
index 27deda70ef8c5931d19ca47e43fe3c365a54f6c1..a62fb6cc6af73dedd9fe749475f6cc0c10caab12 100644 (file)
@@ -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)
index 9aace8c4360ef9e40dc91e28f167e3777f8e30e2..76654c47633c1e56b11f2018ff19fc53a481f709 100644 (file)
@@ -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*/
index 9e31950e2ca1a6a1d1a789d58e5879cbbc5acc5a..5ee50e79335ff45adebcaaa2d4abc5dd6f929373 100644 (file)
@@ -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"
index bb3513a315042985fd4d71d60cf7e43330c4e553..67609b31f0fee3f205b4f2ffa609a15351413c51 100644 (file)
@@ -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);
 
index 9e6c440b0c4679fc4168ffddaacbd2b6b86996d1..cb69187c89bfffc290cc27b2eb7e5bb4a1715d09 100644 (file)
@@ -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,
index 4bab03bf8581593e4586a0dc51394dfb599207f3..e5a026e642f330e5dd6bb7d195d541b7dbd7b366 100644 (file)
@@ -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))
index 4bcd29f7aa5ef8c8faafc0bd51829e04e8e1d54d..b2f09325a5e18b6f5286e69ea80c7136729c2dca 100644 (file)
@@ -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)