]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Fixup of warnings in the code
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 25 Jul 2015 22:55:47 +0000 (15:55 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 25 Jul 2015 22:55:47 +0000 (15:55 -0700)
Ticket: None
Reviewed by: Trivial
Testing:

A bunch of warnings have crept in to the code base.  This
fixes the issue

25 files changed:
bgpd/bgp_community.c
bgpd/bgp_nexthop.c
bgpd/bgp_updgrp.h
bgpd/bgp_updgrp_packet.c
bgpd/bgp_vty.c
bgpd/bgp_zebra.c
bgpd/bgpd.c
bgpd/bgpd.h
lib/bfd.h
lib/ptm_lib.c
lib/ptm_lib.h
ospf6d/ospf6_interface.c
ospf6d/ospf6_interface.h
ospfd/ospf_vty.c
vtysh/vtysh.c
vtysh/vtysh_config.c
vtysh/vtysh_user.c
vtysh/vtysh_user.h
watchquagga/watchquagga.c
zebra/interface.c
zebra/kernel_null.c
zebra/zebra_ptm_null.c
zebra/zebra_ptm_redistribute.c
zebra/zebra_rib.c
zebra/zserv.c

index bdef5fbde6a18c3b64428bb1f45a465db9de1315..0e42b7d2b115d48dac68b1e954264c2e320b86c3 100644 (file)
@@ -217,7 +217,7 @@ set_community_string  (struct community *com)
   json_object *json_string = NULL;
 
   if (!com)
-    return NULL;
+    return;
   
   com->json = json_object_new_object();
   json_community_list = json_object_new_array();
index 658a4b1fd5e6b935c7d894f98f710ddd3055187c..7580f0eb07eedb4a394a73632750d26ba7f83cb7 100644 (file)
@@ -208,7 +208,6 @@ bgp_connected_add (struct connected *ifc)
   struct listnode *node, *nnode, *mnode;
   struct bgp *bgp;
   struct peer *peer;
-  u_int32_t saddr;
 
   addr = ifc->address;
 
index b4e1078b00094e7583f34345ab3b98c47ad60ff8..ae72214631df21e3b7db81f6b642f3c8dc661fdb 100644 (file)
@@ -474,6 +474,8 @@ subgroup_trigger_write (struct update_subgroup *subgrp);
 extern int
 update_group_clear_update_dbg (struct update_group *updgrp, void *arg);
 
+extern void update_bgp_group_free(struct bgp *bgp);
+
 /*
  * Inline functions
  */
index 9aa7a4301fc80ec9732539acf94c7639beb0c595..979a823f17744479a182a1bbb60f2dcad28becbb 100644 (file)
@@ -474,7 +474,7 @@ bpacket_reformat_for_peer (struct bpacket *pkt, struct peer_af *paf)
             stream_put_in_addr_at (s, vec->offset + 1, mod_v4nh);
 
           if (bgp_debug_update(peer, NULL, NULL, 0))
-            zlog_debug ("u" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ nexthop %s",
+            zlog_debug ("u%" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ nexthop %s",
                     PAF_SUBGRP(paf)->update_group->id, PAF_SUBGRP(paf)->id,
                     peer->host, inet_ntoa (*mod_v4nh));
 
@@ -542,14 +542,14 @@ bpacket_reformat_for_peer (struct bpacket *pkt, struct peer_af *paf)
           if (bgp_debug_update(peer, NULL, NULL, 0))
             {
               if (nhlen == 32)
-                zlog_debug ("u" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ mp_nexthops %s, %s",
+                zlog_debug ("u%" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ mp_nexthops %s, %s",
                             PAF_SUBGRP(paf)->update_group->id,
                             PAF_SUBGRP(paf)->id,
                             peer->host,
                             inet_ntop (AF_INET6, mod_v6nhg, buf, BUFSIZ),
                             inet_ntop (AF_INET6, mod_v6nhl, buf2, BUFSIZ));
               else
-                zlog_debug ("u" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ mp_nexthop %s",
+                zlog_debug ("u%" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ mp_nexthop %s",
                             PAF_SUBGRP(paf)->update_group->id,
                             PAF_SUBGRP(paf)->id,
                             peer->host,
index 625473b2546225d1a3179d539d9413ddd3bb0ccc..5f12876b653af10cde5660d5a02fee80ad34ff8a 100644 (file)
@@ -56,41 +56,6 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
 extern struct in_addr router_id_zebra;
 
-/* Intentional re-definition of the auto-generated macros, without table */
-#define QUAGGA_REDIST_STR_BGPD \
-  "(kernel|connected|static|rip|ripng|ospf|ospf6|isis|babel)"
-#define QUAGGA_REDIST_HELP_STR_BGPD \
-  "Kernel routes (not installed via the zebra RIB)\n" \
-  "Connected routes (directly attached subnet or host)\n" \
-  "Statically configured routes\n" \
-  "Routing Information Protocol (RIP)\n" \
-  "Routing Information Protocol next-generation (IPv6) (RIPng)\n" \
-  "Open Shortest Path First (OSPFv2)\n" \
-  "Open Shortest Path First (IPv6) (OSPFv3)\n" \
-  "Intermediate System to Intermediate System (IS-IS)\n" \
-  "Babel routing protocol (Babel)\n"
-#define QUAGGA_IP_REDIST_STR_BGPD \
-  "(kernel|connected|static|rip|ospf|isis|babel)"
-#define QUAGGA_IP_REDIST_HELP_STR_BGPD \
-  "Kernel routes (not installed via the zebra RIB)\n" \
-  "Connected routes (directly attached subnet or host)\n" \
-  "Statically configured routes\n" \
-  "Routing Information Protocol (RIP)\n" \
-  "Open Shortest Path First (OSPFv2)\n" \
-  "Intermediate System to Intermediate System (IS-IS)\n" \
-  "Babel routing protocol (Babel)\n"
-#define QUAGGA_IP6_REDIST_STR_BGPD \
-  "(kernel|connected|static|ripng|ospf6|isis|babel)"
-#define QUAGGA_IP6_REDIST_HELP_STR_BGPD \
-  "Kernel routes (not installed via the zebra RIB)\n" \
-  "Connected routes (directly attached subnet or host)\n" \
-  "Statically configured routes\n" \
-  "Routing Information Protocol next-generation (IPv6) (RIPng)\n" \
-  "Open Shortest Path First (IPv6) (OSPFv3)\n" \
-  "Intermediate System to Intermediate System (IS-IS)\n" \
-  "Babel routing protocol (Babel)\n"
-
-
 /* Utility function to get address family from current node.  */
 afi_t
 bgp_node_afi (struct vty *vty)
index 23de75ae733916cf0c748eadda4ddd3cfc5ee9ba..8a9beb8f0fc17facfd15cf0e360bf22645299355 100644 (file)
@@ -1335,10 +1335,11 @@ bgp_zebra_announce (struct prefix *p, struct bgp_info *info, struct bgp *bgp,
 
           if (valid_nh_count)
             zapi_ipv4_route_ipv6_nexthop (ZEBRA_IPV4_ROUTE_IPV6_NEXTHOP_ADD,
-                                          zclient, (struct prefix_ipv4 *) p, &api);
+                                          zclient, (struct prefix_ipv4 *) p,
+                                         (struct zapi_ipv6 *)&api);
           else
             zapi_ipv4_route (ZEBRA_IPV4_ROUTE_DELETE,
-                             zclient, (struct prefix_ipv4 *) p, &api);
+                             zclient, (struct prefix_ipv4 *) p, (struct zapi_ipv4 *)&api);
         }
       else
         {
index 53756cb89154077d394b981310925447f711457e..16bfb504078db50aeae86a097dc6b52b8ae0a082 100644 (file)
@@ -36,6 +36,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 #include "linklist.h"
 #include "workqueue.h"
 #include "queue.h"
+#include "zclient.h"
 #include "bfd.h"
 
 #include "bgpd/bgpd.h"
@@ -67,7 +68,6 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 #include "bgpd/bgp_updgrp.h"
 #include "bgpd/bgp_bfd.h"
 
-
 /* BGP process wide configuration.  */
 static struct bgp_master bgp_master;
 
@@ -1180,7 +1180,7 @@ bgp_peer_conf_if_to_su_update (struct peer *peer)
   if (!peer->conf_if)
     return;
 
-  if (ifp = if_lookup_by_name(peer->conf_if))
+  if ((ifp = if_lookup_by_name(peer->conf_if)))
     {
       /* if multiple IP addresses assigned to link, we pick the first */
       if (!CHECK_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY))
@@ -2520,7 +2520,6 @@ peer_group_unbind (struct bgp *bgp, struct peer *peer,
                   struct peer_group *group, afi_t afi, safi_t safi)
 {
   struct peer *other;
-  int v6only;
 
   if (! peer->af_group[afi][safi])
       return 0;
@@ -5726,7 +5725,7 @@ peer_ttl_security_hops_unset (struct peer *peer)
        }
     }
 
-  return 0;
+  return ret;
 }
 
 /*
index 95939fe0a8cb7c114f93e74a0827e674bc476a0b..851132cb8bf4860ea2b8740f04d489b4940f5b2d 100644 (file)
@@ -613,7 +613,7 @@ struct peer
 #define PEER_FLAG_LONESOUL                  (1 << 11)
 #define PEER_FLAG_DYNAMIC_NEIGHBOR          (1 << 12) /* dynamic neighbor */
 #define PEER_FLAG_CAPABILITY_ENHE           (1 << 13) /* Extended next-hop (rfc 5549)*/
-#define PEER_FLAG_IFPEER_V6ONLY             (1 << 14) /* if-based peer is v6 only *
+#define PEER_FLAG_IFPEER_V6ONLY             (1 << 14) /* if-based peer is v6 only */
 
   /* NSF mode (graceful restart) */
   u_char nsf[AFI_MAX][SAFI_MAX];
@@ -814,7 +814,7 @@ u_char last_reset_cause[BGP_MAX_PACKET_SIZE];
 #define PEER_RMAP_TYPE_EXPORT         (1 << 7) /* neighbor route-map export */
 
   /* peer specific BFD information */
-  void *bfd_info;
+  struct bfd_info *bfd_info;
 };
 
 #define PEER_PASSWORD_MINLEN   (1)
index 6ad1868dc2ddd5924083567a0984c5b2fd6686c4..f0051d93a211680db9523c0c3e6385031242e0dc 100644 (file)
--- a/lib/bfd.h
+++ b/lib/bfd.h
@@ -53,7 +53,7 @@ extern struct bfd_info *
 bfd_info_create(void);
 
 extern void
-bfd_info_free(void **bfd_info);
+bfd_info_free(struct bfd_info **bfd_info);
 
 extern int
 bfd_validate_param(struct vty *vty, const char *dm_str, const char *rx_str,
index 175cf1443e4c44f983699be0de6c95d13219a734..bcf0be623d8048a2033c73ddf5d87d3146a08a42 100644 (file)
@@ -124,7 +124,7 @@ _ptm_lib_decode_header (csv_t *csv,
 
 int
 ptm_lib_append_msg(ptm_lib_handle_t *hdl, void *ctxt,
-                   const char *key, char *val)
+                   const char *key, const char *val)
 {
     ptm_lib_msg_ctxt_t *p_ctxt = ctxt;
     csv_t *csv;
index 1aa2f356f565fc84d804b6913fb83374f121836b..e79529a8194ee869986ae6ceefa339c137165ff8 100644 (file)
@@ -45,5 +45,5 @@ ptm_lib_handle_t *ptm_lib_register(char *, ptm_cmd_cb, ptm_notify_cb, ptm_respon
 void ptm_lib_deregister(ptm_lib_handle_t *);
 int ptm_lib_find_key_in_msg(void *, const char *, char *);
 int ptm_lib_init_msg(ptm_lib_handle_t *, int, int, void *, void **);
-int ptm_lib_append_msg(ptm_lib_handle_t *, void *, const char *, char *);
+int ptm_lib_append_msg(ptm_lib_handle_t *, void *, const char *, const char *);
 int ptm_lib_complete_msg(ptm_lib_handle_t *, void *, char *, int *);
index a45bdd5d6e4aaebc84f891dda0a36643b220ed68..63783cc8f014925867644d860ffb2afcd0f4703c 100644 (file)
@@ -28,6 +28,7 @@
 #include "thread.h"
 #include "prefix.h"
 #include "plist.h"
+#include "zclient.h"
 #include "bfd.h"
 
 #include "ospf6_lsa.h"
index 6ef9e37822b5657114883e2888c10ba09fc2146b..3f5c5f041f19c3658a5d23895aebb05a78b6ebd9 100644 (file)
@@ -115,7 +115,7 @@ struct ospf6_interface
   char *plist_name;
 
   /* BFD information */
-  void *bfd_info;
+  struct bfd_info *bfd_info;
 };
 
 /* interface state */
index 06cf7fa27239ae9d0426dc070e4666c750eb5a4d..ef6012d3efc24c76960ebaf545f56c01a0899c69 100644 (file)
 #include "ospfd/ospf_dump.h"
 #include "ospfd/ospf_bfd.h"
 
-#define QUAGGA_REDIST_STR_OSPFD \
-  "(kernel|connected|static|rip|isis|bgp|babel)"
-#define QUAGGA_REDIST_HELP_STR_OSPFD \
-  "Kernel routes (not installed via the zebra RIB)\n" \
-  "Connected routes (directly attached subnet or host)\n" \
-  "Statically configured routes\n" \
-  "Routing Information Protocol (RIP)\n" \
-  "Intermediate System to Intermediate System (IS-IS)\n" \
-  "Border Gateway Protocol (BGP)\n" \
-  "Babel routing protocol (Babel)\n"
-
-
 static const char *ospf_network_type_str[] =
 {
   "Null",
index bf2d01ca207bccb5de9b7ef145f4a69aa2cf3737..b1c9f453b6cc11e773f0bef8b2c46a6882abc9c8 100644 (file)
@@ -2020,7 +2020,6 @@ backup_config_file (const char *fbackup)
 static int
 write_config_integrated(void)
 {
-  int ret;
   u_int i;
   char line[] = "write terminal\n";
   FILE *fp, *fp1;
index 2290091efe825d761a9b42e87e144307126454df..b60b83120c853a6814ad73f04a577b3b28f90d8b 100644 (file)
@@ -25,6 +25,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 #include "memory.h"
 
 #include "vtysh/vtysh.h"
+#include "vtysh/vtysh_user.h"
 
 /* 
  * Compiler is warning about prototypes not being declared.
index a17f7a7176187abd8141e8441bd0ad2027b90eed..985c53dcebf566e151bd63a30447d4cdc059101e 100644 (file)
@@ -37,6 +37,7 @@
 #include "memory.h"
 #include "linklist.h"
 #include "command.h"
+#include "vtysh/vtysh_user.h"
 
 /* 
  * Compiler is warning about prototypes not being declared.
@@ -47,7 +48,6 @@ int vtysh_pam(const char *);
 struct vtysh_user *user_new(void);
 void user_free(struct vtysh_user *);
 struct vtysh_user *user_lookup(const char *);
-void user_config_write(void);
 struct vtysh_user *user_get(const char *);
 int vtysh_auth(void);
 void vtysh_user_init(void);
index 8d0a4cf6aee644851426de4297a9bb69d057447a..43d125505cb9d317d064811995a53c1f6b58b912 100644 (file)
@@ -23,5 +23,6 @@
 #define _VTYSH_USER_H
 
 int vtysh_auth ();
+void user_config_write(void);
 
 #endif /* _VTYSH_USER_H */
index 0b48708b780ba05dc9c617a63ed02580005b4bb6..1e930f4018daac9b38dd682b74d229af537fc0d7 100644 (file)
@@ -329,7 +329,7 @@ DEFAULT_PERIOD,DEFAULT_TIMEOUT,DEFAULT_RESTART_TIMEOUT,DEFAULT_PIDFILE);
 }
 
 static pid_t
-run_background(const char *shell_cmd)
+run_background(char *shell_cmd)
 {
   pid_t child;
 
@@ -345,8 +345,10 @@ run_background(const char *shell_cmd)
       if (setpgid(0,0) < 0)
         zlog_warn("warning: setpgid(0,0) failed: %s",safe_strerror(errno));
       {
-        const char *argv[4] = { "sh", "-c", shell_cmd, NULL};
-       execv("/bin/sh",(char *const *)argv);
+       char shell[] = "sh";
+       char dashc[] = "-c";
+       char * const argv[4] = { shell, dashc, shell_cmd, NULL};
+       execv("/bin/sh", argv);
        zlog_err("execv(/bin/sh -c '%s') failed: %s",
                 shell_cmd,safe_strerror(errno));
        _exit(127);
index 70cdf36f8ae536720a3c038b8aae505647e93e61..4329efd2a0fd056a53cb944582c613bd585485f2 100644 (file)
@@ -43,6 +43,7 @@
 #include "zebra/zebra_ptm.h"
 #include "zebra/rt_netlink.h"
 #include "zebra/zserv.h"
+#include "zebra/interface.h"
 
 #define ZEBRA_PTM_SUPPORT
 
@@ -530,7 +531,7 @@ if_delete_update (struct interface *ifp)
   ifp->ifindex = IFINDEX_INTERNAL;
 }
 
-void
+static void
 ipv6_ll_address_to_mac (struct in6_addr *address, u_char *mac)
 {
   mac[0] = address->s6_addr[8] ^ 0x02;
@@ -548,16 +549,16 @@ if_nbr_ipv6ll_to_ipv4ll_neigh_update (struct interface *ifp,
 {
   char buf[16] = "169.254.0.1";
   struct in_addr ipv4_ll;
-  u_char mac[6];
+  char mac[6];
 
   inet_pton (AF_INET, buf, &ipv4_ll);
 
-  ipv6_ll_address_to_mac(address, mac);
+  ipv6_ll_address_to_mac(address, (u_char *)mac);
   netlink_neigh_update (add ? RTM_NEWNEIGH : RTM_DELNEIGH,
                         ifp->ifindex, ipv4_ll.s_addr, mac, 6);
 }
 
-void
+static void
 if_nbr_ipv6ll_to_ipv4ll_neigh_add_all (struct interface *ifp)
 {
   if (listhead(ifp->nbr_connected))
@@ -587,7 +588,7 @@ if_nbr_ipv6ll_to_ipv4ll_neigh_del_all (struct interface *ifp)
     }
 }
 
-void
+static void
 if_down_del_nbr_connected (struct interface *ifp)
 {
   struct nbr_connected *nbr_connected;
index 9b45acb79b0c99850bbaea15c8e02e4d39f8b488..5f37e0cc7c030f5e440af962b8804c7c138860ea 100644 (file)
@@ -7,6 +7,7 @@
 #include "zebra/rt.h"
 #include "zebra/redistribute.h"
 #include "zebra/connected.h"
+#include "zebra/rt_netlink.h"
 
 int kernel_add_ipv4 (struct prefix *a, struct rib *b) { return 0; }
 int kernel_update_ipv4 (struct prefix *a, struct rib *b) { return 0; }
index a9e2333763685d8c641be84b21fd1e28f1c73765..ad48f238565cdcda01966d9ed99f00fd0e9ecb78 100644 (file)
@@ -20,6 +20,8 @@
  */
 #include <zebra.h>
 #include "prefix.h"
+#include "if.h"
+#include "zebra_ptm_redistribute.h"
 
 void zebra_interface_bfd_update (struct interface *a, struct prefix *dp,
                                  struct prefix *sp)
index 40394f059c78631ef0452c1b5e9f4150a948d025..6166fc002612cd85d4b6121a5b8285396b162526 100644 (file)
 #include "vty.h"
 #include "stream.h"
 #include "zebra/zserv.h"
+#include "zebra/zebra_ptm_redistribute.h"
 
 /* master zebra server structure */
 extern struct zebra_t zebrad;
 
-int
+static int
 zsend_interface_bfd_update (int cmd, struct zserv *client,
                             struct interface *ifp, struct prefix *dp,
                             struct prefix *sp)
@@ -88,7 +89,7 @@ zebra_interface_bfd_update (struct interface *ifp, struct prefix *dp,
     }
 }
 
-int
+static int
 zsend_bfd_peer_replay (int cmd, struct zserv *client)
 {
   struct stream *s;
index 0d11927e3f238c2142c0cc947e4180e017f83284..41a7f68b885f667a372636922e3f4f88a315ac10 100644 (file)
@@ -43,6 +43,7 @@
 #include "zebra/debug.h"
 #include "zebra/zebra_fpm.h"
 #include "zebra/zebra_rnh.h"
+#include "zebra/interface.h"
 
 /* Default rtm_table for all clients */
 extern struct zebra_t zebrad;
@@ -3240,7 +3241,7 @@ rib_add_ipv6_multipath (struct prefix *p, struct rib *rib, safi_t safi,
       if (!table)
         return 0;
       /* Make it sure prefixlen is applied to the prefix. */
-      apply_mask_ipv4 (p);
+      apply_mask_ipv4 ((struct prefix_ipv4 *)p);
     }
   else
     {
@@ -3263,7 +3264,7 @@ rib_add_ipv6_multipath (struct prefix *p, struct rib *rib, safi_t safi,
         return 0;
 
       /* Make sure mask is applied. */
-      apply_mask_ipv6 (p);
+      apply_mask_ipv6 ((struct prefix_ipv6 *)p);
 
     }
 
index 51a69a961be978abc567dfa5079bd20b4b1f7880..188665814aa9adf1c92ccfb3d1b950f13c089e66 100644 (file)
@@ -45,6 +45,8 @@
 #include "zebra/ipforward.h"
 #include "zebra/zebra_rnh.h"
 #include "zebra/rt_netlink.h"
+#include "zebra/interface.h"
+#include "zebra/zebra_ptm.h"
 
 /* Event list of zebra. */
 enum event { ZEBRA_SERV, ZEBRA_READ, ZEBRA_WRITE };
@@ -1254,7 +1256,6 @@ zread_ipv4_route_ipv6_nexthop_add (struct zserv *client, u_short length)
   u_char nexthop_type;
   unsigned long ifindex;
   struct prefix_ipv4 p;
-  u_char ifname_len;
   safi_t safi;
   static struct in6_addr nexthops[MULTIPATH_NUM];
   static unsigned int ifindices[MULTIPATH_NUM];