]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: zebra-warnings.patch
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 20 May 2015 01:04:26 +0000 (18:04 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 20 May 2015 01:04:26 +0000 (18:04 -0700)
Remove compiled warnings for the zebra directory
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:

18 files changed:
zebra/connected.c
zebra/if_netlink.c
zebra/if_proc.c
zebra/irdp_interface.c
zebra/misc_null.c
zebra/redistribute.c
zebra/rib.h
zebra/router-id.c
zebra/rt_netlink.c
zebra/rt_netlink.h
zebra/rtadv.c
zebra/rtread_netlink.c
zebra/zebra_ptm.c
zebra/zebra_rib.c
zebra/zebra_routemap.c
zebra/zebra_vty.c
zebra/zserv.c
zebra/zserv.h

index 0c9221da43663abbcd03f98461d90ba012dbd89f..b891f9e56c310f3d93279396d192b59608f8c6bc 100644 (file)
@@ -80,18 +80,18 @@ connected_announce (struct interface *ifp, struct connected *ifc)
 
   if (ifc->address->family == AF_INET)
     {
-    if (ifc->anchor = if_anchor_lookup_by_address(ifc->address->u.prefix4))
-      {
-        /* found an anchor, so I'm unnumbered */
-        SET_FLAG (ifc->flags, ZEBRA_IFA_UNNUMBERED);
-        listnode_add (ifc->anchor->unnumbered, ifc);
-      }
-    else
-      {
-        /* I'm numbered */
-        UNSET_FLAG (ifc->flags, ZEBRA_IFA_UNNUMBERED);
-        ifc->unnumbered = list_new();
-      }
+      if ((ifc->anchor = if_anchor_lookup_by_address(ifc->address->u.prefix4)))
+       {
+         /* found an anchor, so I'm unnumbered */
+         SET_FLAG (ifc->flags, ZEBRA_IFA_UNNUMBERED);
+         listnode_add (ifc->anchor->unnumbered, ifc);
+       }
+      else
+       {
+         /* I'm numbered */
+         UNSET_FLAG (ifc->flags, ZEBRA_IFA_UNNUMBERED);
+         ifc->unnumbered = list_new();
+       }
     }
 
   listnode_add (ifp->connected, ifc);
index 86bd8ffe4cb6b328ace69e60f7bce7cf39773bbc..2016986cb5c52e2a5407bffa51a513db193009d0 100644 (file)
@@ -23,8 +23,7 @@
 #include <zebra.h>
 
 #include "zebra/zserv.h"
-
-extern int interface_lookup_netlink (void);
+#include "zebra/rt_netlink.h"
 
 /* Interface information read by netlink. */
 void
index 2dbc472611a5c2c4f1e6b1535eb2bfbb6e6d161f..eab511c845c48f79dbafb2f11aef94673855e8d5 100644 (file)
@@ -123,7 +123,7 @@ ifstat_dev_fields (int version, char *buf, struct interface *ifp)
 }
 
 /* Update interface's statistics. */
-void
+static void
 ifstat_update_proc (void)
 {
   FILE *fp;
index 6403830b9af8c008a87e6cb57d7a83d39abc3c63..43c63a83f07f13fe30ad950c9c830343f3fa1948 100644 (file)
@@ -638,7 +638,6 @@ DEFUN (no_ip_irdp_address_preference,
 {
   struct listnode *node, *nnode;
   struct in_addr ip; 
-  int pref;
   int ret;
   struct interface *ifp;
   struct zebra_if *zi;
@@ -657,8 +656,6 @@ DEFUN (no_ip_irdp_address_preference,
   if (!ret) 
     return CMD_WARNING;
 
-  pref = atoi(argv[1]);
-
   for (ALL_LIST_ELEMENTS (irdp->AdvPrefList, node, nnode, adv))
     {
       if(adv->ip.s_addr == ip.s_addr )
index 06807267e875171cb9973d0e2e73138611593ad6..6cdfb0f54cfb726b06a833f84c37f15578461ad6 100644 (file)
@@ -6,7 +6,7 @@
 #include "zebra/interface.h"
 #include "zebra/zebra_fpm.h"
 
-void ifstat_update_proc (void) { return; }
+static void ifstat_update_proc (void) { return; }
 #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
 #pragma weak rtadv_config_write = ifstat_update_proc
 #pragma weak irdp_config_write = ifstat_update_proc
index 2ee5da5d944798b265c23a26fe62ee242d4b0637..843f5ad4b06429053f8df67c7b01ffd63646cfb5 100644 (file)
@@ -626,8 +626,8 @@ zebra_import_table (afi_t afi, u_int32_t table_id, u_int32_t distance, int add)
       if (!rib)
        continue;
 
-      if ((afi == AFI_IP) && (rn->p.family == AF_INET) ||
-         (afi == AFI_IP6) && (rn->p.family == AF_INET6))
+      if (((afi == AFI_IP) && (rn->p.family == AF_INET)) ||
+         ((afi == AFI_IP6) && (rn->p.family == AF_INET6)))
        {
          if (add)
            zebra_add_import_table_entry (rn, rib);
index 038fe447567f874c9ac826053cbfcca45fea50b8..a05bd8c1960ca94ea43e3f799bc131df9d496205 100644 (file)
@@ -53,7 +53,7 @@ struct rib
   u_short instance;
 
   /* Which routing table */
-  int table;
+  uint32_t table;
 
   /* Metric */
   u_int32_t metric;
index b738027ec4cc4810c241472dbb3d88bb9c977a76..ae52b5ea6c538f49315a4b5b8bc3a9a50cb701eb 100644 (file)
 #include "zebra/router-id.h"
 #include "zebra/redistribute.h"
 
-static struct list rid_all_sorted_list;
-static struct list rid_lo_sorted_list;
+static struct list _rid_all_sorted_list;
+static struct list _rid_lo_sorted_list;
+static struct list *rid_all_sorted_list = &_rid_all_sorted_list;
+static struct list *rid_lo_sorted_list = &_rid_lo_sorted_list;
 static struct prefix rid_user_assigned;
 
 /* master zebra server structure */
@@ -86,15 +88,15 @@ router_id_get (struct prefix *p)
 
   if (rid_user_assigned.u.prefix4.s_addr)
     p->u.prefix4.s_addr = rid_user_assigned.u.prefix4.s_addr;
-  else if (!list_isempty (&rid_lo_sorted_list))
+  else if (!list_isempty (rid_lo_sorted_list))
     {
-      node = listtail (&rid_lo_sorted_list);
+      node = listtail (rid_lo_sorted_list);
       c = listgetdata (node);
       p->u.prefix4.s_addr = c->address->u.prefix4.s_addr;
     }
-  else if (!list_isempty (&rid_all_sorted_list))
+  else if (!list_isempty (rid_all_sorted_list))
     {
-      node = listtail (&rid_all_sorted_list);
+      node = listtail (rid_all_sorted_list);
       c = listgetdata (node);
       p->u.prefix4.s_addr = c->address->u.prefix4.s_addr;
     }
@@ -131,9 +133,9 @@ router_id_add_address (struct connected *ifc)
 
   if (!strncmp (ifc->ifp->name, "lo", 2)
       || !strncmp (ifc->ifp->name, "dummy", 5))
-    l = &rid_lo_sorted_list;
+    l = rid_lo_sorted_list;
   else
-    l = &rid_all_sorted_list;
+    l = rid_all_sorted_list;
   
   if (!router_id_find_node (l, ifc))
     listnode_add_sort (l, ifc);
@@ -164,9 +166,9 @@ router_id_del_address (struct connected *ifc)
 
   if (!strncmp (ifc->ifp->name, "lo", 2)
       || !strncmp (ifc->ifp->name, "dummy", 5))
-    l = &rid_lo_sorted_list;
+    l = rid_lo_sorted_list;
   else
-    l = &rid_all_sorted_list;
+    l = rid_all_sorted_list;
 
   if ((c = router_id_find_node (l, ifc)))
     listnode_delete (l, c);
@@ -240,12 +242,12 @@ router_id_init (void)
   install_element (CONFIG_NODE, &router_id_cmd);
   install_element (CONFIG_NODE, &no_router_id_cmd);
 
-  memset (&rid_all_sorted_list, 0, sizeof (rid_all_sorted_list));
-  memset (&rid_lo_sorted_list, 0, sizeof (rid_lo_sorted_list));
+  memset (rid_all_sorted_list, 0, sizeof (rid_all_sorted_list));
+  memset (rid_lo_sorted_list, 0, sizeof (rid_lo_sorted_list));
   memset (&rid_user_assigned, 0, sizeof (rid_user_assigned));
 
-  rid_all_sorted_list.cmp = router_id_cmp;
-  rid_lo_sorted_list.cmp = router_id_cmp;
+  rid_all_sorted_list->cmp = router_id_cmp;
+  rid_lo_sorted_list->cmp = router_id_cmp;
 
   rid_user_assigned.family = AF_INET;
   rid_user_assigned.prefixlen = 32;
index 3410e4e1eab3dc1cb5f842585bcf50192f55c9e4..0de024ce1d78e796e3bde9bda0fa40e9679c9688 100644 (file)
@@ -1247,7 +1247,7 @@ netlink_route_read (void)
 /* Utility function  comes from iproute2. 
    Authors:    Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> */
 int
-addattr_l (struct nlmsghdr *n, int maxlen, int type, void *data, int alen)
+addattr_l (struct nlmsghdr *n, unsigned int maxlen, int type, void *data, int alen)
 {
   int len;
   struct rtattr *rta;
@@ -1289,7 +1289,7 @@ rta_addattr_l (struct rtattr *rta, int maxlen, int type, void *data, int alen)
 /* Utility function comes from iproute2. 
    Authors:    Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> */
 int
-addattr32 (struct nlmsghdr *n, int maxlen, int type, int data)
+addattr32 (struct nlmsghdr *n, unsigned int maxlen, int type, int data)
 {
   int len;
   struct rtattr *rta;
index 2a4ce016152ec783a5ec8391c5371324e7b28e68..14e811db31cfb5dfcbd91755fb2fc8fbff1c5909 100644 (file)
@@ -28,9 +28,9 @@
 #define NL_DEFAULT_ROUTE_METRIC 20
 
 extern int
-addattr32 (struct nlmsghdr *n, int maxlen, int type, int data);
+addattr32 (struct nlmsghdr *n, unsigned int maxlen, int type, int data);
 extern int
-addattr_l (struct nlmsghdr *n, int maxlen, int type, void *data, int alen);
+addattr_l (struct nlmsghdr *n, unsigned int maxlen, int type, void *data, int alen);
 
 extern int
 rta_addattr_l (struct rtattr *rta, int maxlen, int type, void *data, int alen);
@@ -41,6 +41,8 @@ nl_msg_type_to_str (uint16_t msg_type);
 extern const char *
 nl_rtproto_to_str (u_char rtproto);
 
+extern int netlink_route_read(void);
+extern int interface_lookup_netlink(void);
 
 #endif /* HAVE_NETLINK */
 
index 766a2184b551113fc7d76579f6e2fd710c22f167..67f6ddb4e950428ab9201e5af02a4af9885cd048 100644 (file)
@@ -493,7 +493,7 @@ rtadv_process_advert (u_char *msg, unsigned int len, struct interface *ifp,
     }
 
   if ((radvert->nd_ra_retransmit && zif->rtadv.AdvRetransTimer) &&
-      (ntohl(radvert->nd_ra_retransmit) != zif->rtadv.AdvRetransTimer))
+      (ntohl(radvert->nd_ra_retransmit) != (unsigned int)zif->rtadv.AdvRetransTimer))
     {
       zlog_warn("our AdvRetransTimer on %s doesn't agree with %s",
                 ifp->name, addr_str);
index 066e8443384c8125f828070c4e6380252622a771..09191d517bec8764e54206041b4a20753d0507a3 100644 (file)
@@ -23,8 +23,7 @@
 #include <zebra.h>
 
 #include "zebra/zserv.h"
-
-extern void netlink_route_read (void);
+#include "zebra/rt_netlink.h"
 
 void route_read (void)
 {
index 176e3e4ddfacdd2b838dc3dcc259315802d72ece..fc0a2d43fb321b61ba0ad010507e36af47fe8fd5 100644 (file)
 
 #define PTM_MSG_LEN     4
 #define PTM_HEADER_LEN  37
-char *ZEBRA_PTM_GET_STATUS_CMD = "get-status";
-char *ZEBRA_PTM_PORT_STR = "port";
-char *ZEBRA_PTM_CBL_STR = "cbl status";
-char *ZEBRA_PTM_PASS_STR = "pass";
-char *ZEBRA_PTM_FAIL_STR = "fail";
-char *ZEBRA_PTM_BFDSTATUS_STR = "BFD status";
-char *ZEBRA_PTM_BFDDEST_STR = "BFD peer";
+const char *ZEBRA_PTM_GET_STATUS_CMD = "get-status";
+const char *ZEBRA_PTM_PORT_STR = "port";
+const char *ZEBRA_PTM_CBL_STR = "cbl status";
+const char *ZEBRA_PTM_PASS_STR = "pass";
+const char *ZEBRA_PTM_FAIL_STR = "fail";
+const char *ZEBRA_PTM_BFDSTATUS_STR = "BFD status";
+const char *ZEBRA_PTM_BFDDEST_STR = "BFD peer";
 
 extern struct zebra_t zebrad;
 int ptm_enable;
@@ -204,7 +204,7 @@ zebra_ptm_install_commands (void)
 }
 
 static char *
-zebra_ptm_find_key(char *key_arg, char *arg, int arglen)
+zebra_ptm_find_key(const char *key_arg, char *arg, int arglen)
 {
   char buf[ZEBRA_PTM_MAX_SOCKBUF];
   char *data, *hdr, *key, *val;
@@ -287,7 +287,7 @@ zebra_ptm_handle_bfd_msg(char *buf, int buflen)
   if (!strcmp (bfdst_str, ZEBRA_PTM_FAIL_STR)) {
          if (ifp->ptm_enable && if_is_no_ptm_operative (ifp)) {
         if (inet_pton(AF_INET, dest_str, &dest_addr) <= 0) {
-            zlog_err("%s: Peer addr not found\n", __func__,
+            zlog_err("%s: Peer addr(%s) not found\n", __func__,
                dest_str);
             return;
         }
index f1a44fdda21475435ceb7a80cb2d96b87114c32d..3886e220b8cb78109f6e89eda3133b358a136876 100644 (file)
@@ -228,7 +228,7 @@ is_zebra_main_routing_table(u_int32_t table_id)
 }
 
 /* Add nexthop to the end of a nexthop list.  */
-void
+static void
 _nexthop_add (struct nexthop **target, struct nexthop *nexthop)
 {
   struct nexthop *last;
@@ -3132,7 +3132,7 @@ rib_add_ipv6_multipath (struct prefix_ipv6 *p, struct rib *rib, safi_t safi,
   struct rib *same = NULL;
   struct nexthop *nexthop;
   int ret = 0;
-  int table_id = 0;
+  unsigned int table_id = 0;
 
   if (rib)
     table_id = rib->table;
index 8ac08960a6a78b6af0bb8abfcb5d179fe5500b0e..ec8ee45cdf6f72f7a0fdd9f62960b97ad36ab7c6 100644 (file)
@@ -87,7 +87,7 @@ zebra_route_match_delete (struct vty *vty, struct route_map_index *index,
                          route_map_event_t type)
 {
   int ret;
-  char *dep_name = (char *)arg;
+  char *dep_name = NULL;
   const char *tmpstr;
   char *rmap_name = NULL;
 
@@ -99,6 +99,10 @@ zebra_route_match_delete (struct vty *vty, struct route_map_index *index,
          if ((tmpstr = route_map_get_match_arg(index, command)) != NULL)
            dep_name = XSTRDUP(MTYPE_ROUTE_MAP_RULE, tmpstr);
        }
+      else
+       {
+         dep_name = XSTRDUP(MTYPE_ROUTE_MAP_RULE, arg);
+       }
       rmap_name = XSTRDUP(MTYPE_ROUTE_MAP_NAME, index->map->name);
     }
 
@@ -119,7 +123,7 @@ zebra_route_match_delete (struct vty *vty, struct route_map_index *index,
   if (type != RMAP_EVENT_MATCH_DELETED && dep_name)
     route_map_upd8_dependency(type, dep_name, rmap_name);
 
-  if (arg == NULL && dep_name)
+  if (dep_name)
     XFREE(MTYPE_ROUTE_MAP_RULE, dep_name);
   if (rmap_name)
     XFREE(MTYPE_ROUTE_MAP_NAME, rmap_name);
index ab6e5ec7b568647f71e25c84c663702205ef1e33..a36f8600b2e3f2639e719faf95f865cdcc2925d8 100644 (file)
@@ -1289,8 +1289,7 @@ DEFUN (show_ip_route_tag,
 
         if (first)
           {
-            vty_out (vty, SHOW_ROUTE_V4_HEADER, VTY_NEWLINE, VTY_NEWLINE,
-                     VTY_NEWLINE);
+            vty_out (vty, SHOW_ROUTE_V4_HEADER);
             first = 0;
           }
         vty_show_ip_route (vty, rn, rib);
@@ -2959,7 +2958,6 @@ DEFUN (ip_zebra_import_table_distance,
 {
   u_int32_t table_id = 0;
   int distance = ZEBRA_TABLE_DISTANCE_DEFAULT;
-  char *route_map_name = NULL;
 
   if (argc)
     VTY_GET_INTEGER("table", table_id, argv[0]);
index fb138c11bbccbd7c4b11dc15d73bb4f113dc45e6..79c469cfc2ab2fc1468dae9369db3a5235af47d2 100644 (file)
@@ -858,8 +858,6 @@ zserv_rnh_unregister (struct zserv *client, int sock, u_short length,
   struct stream *s;
   struct prefix p;
   u_short l = 0;
-  u_char flags;
-  u_char exact_match;
 
   if (IS_ZEBRA_DEBUG_NHT)
     zlog_debug("rnh_unregister msg from client %s: length=%d\n",
@@ -869,7 +867,7 @@ zserv_rnh_unregister (struct zserv *client, int sock, u_short length,
 
   while (l < length)
     {
-      flags = stream_getc(s);
+      (void)stream_getc(s); //Connected or not.  Not used in this function
       p.family = stream_getw(s);
       p.prefixlen = stream_getc(s);
       l += 4;
@@ -1281,7 +1279,6 @@ zread_ipv6_add (struct zserv *client, u_short length)
   u_char nexthop_type;
   unsigned long ifindex;
   struct prefix_ipv6 p;
-  u_char ifname_len;
   safi_t safi;
   static struct in6_addr nexthops[MULTIPATH_NUM];
   static unsigned int ifindices[MULTIPATH_NUM];
index 22d150083a1a38c23027ce5005cd27d2cb792db0..a344cbd0c63e472ece69e8d5e9b86cb06dc25aee 100644 (file)
@@ -26,6 +26,7 @@
 #include "if.h"
 #include "workqueue.h"
 #include "routemap.h"
+#include "vty.h"
 #include "zclient.h"
 
 /* Default port information. */
@@ -113,7 +114,7 @@ struct zebra_t
   struct list *client_list;
 
   /* default table */
-  int rtm_table_default;
+  u_int32_t rtm_table_default;
 
   /* rib work queue */
   struct work_queue *ribq;