]> git.puffer.fish Git - mirror/frr.git/commitdiff
[bgpd] fix a couple of trivial compiler warnings
authorPaul Jakma <paul.jakma@sun.com>
Tue, 22 Jul 2008 19:56:56 +0000 (19:56 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Tue, 22 Jul 2008 19:56:56 +0000 (19:56 +0000)
2008-07-22 Paul Jakma <paul.jakma@sun.com>

* bgp_community.c: (community_str2com) assigns defaults to local
  vars
* bgp_attr.c: (bgp_attr_parse) match format specifier to arg
* bgp_table.{c,h}: (bgp_table_top) can take a * to a const, quelling
  warning in bgp_route.c

bgpd/ChangeLog
bgpd/bgp_attr.c
bgpd/bgp_community.c
bgpd/bgp_table.c
bgpd/bgp_table.h

index 2150add3385ba6c9cfcebabebef4bf544eb1b916..242449473ae689a5b100c7b68f958a14eb115659 100644 (file)
@@ -1,3 +1,11 @@
+2008-07-22 Paul Jakma <paul.jakma@sun.com>
+
+       * bgp_community.c: (community_str2com) assigns defaults to local
+         vars
+       * bgp_attr.c: (bgp_attr_parse) match format specifier to arg
+       * bgp_table.{c,h}: (bgp_table_top) can take a * to a const, quelling
+         warning in bgp_route.c
 2008-07-21 Paul Jakma <paul.jakma@sun.com>
 
 
index 19a0869f60679c5e37ba5ea18166fffb6ccff425..752099d1fc0df34807e740833e958bece5ebc669 100644 (file)
@@ -1571,7 +1571,7 @@ bgp_attr_parse (struct peer *peer, struct attr *attr, bgp_size_t size,
           && ((endp - startp) < (BGP_ATTR_MIN_LEN + 1)))
        {
          zlog (peer->log, LOG_WARNING, 
-               "%s Extended length set, but just %u bytes of attr header",
+               "%s Extended length set, but just %lu bytes of attr header",
                peer->host,
                (unsigned long) (endp - STREAM_PNT (BGP_INPUT (peer))));
 
index d5e9821be9ff84752d75bde0716f056d178df2d0..592b810d4c9a60959400fae1ee1da73a431b643c 100644 (file)
@@ -581,8 +581,8 @@ community_str2com (const char *str)
 {
   struct community *com = NULL;
   struct community *com_sort = NULL;
-  u_int32_t val;
-  enum community_token token;
+  u_int32_t val = 0;
+  enum community_token token = community_token_unknown;
 
   do 
     {
index be598328d1a251356c0340d725be5d72a5c9fd75..c2120252274b6f101f80030f1372b6202ca4ade9 100644 (file)
@@ -230,7 +230,7 @@ bgp_unlock_node (struct bgp_node *node)
 
 /* Find matched prefix. */
 struct bgp_node *
-bgp_node_match (struct bgp_table *table, struct prefix *p)
+bgp_node_match (const struct bgp_table *table, struct prefix *p)
 {
   struct bgp_node *node;
   struct bgp_node *matched;
@@ -256,7 +256,7 @@ bgp_node_match (struct bgp_table *table, struct prefix *p)
 }
 
 struct bgp_node *
-bgp_node_match_ipv4 (struct bgp_table *table, struct in_addr *addr)
+bgp_node_match_ipv4 (const struct bgp_table *table, struct in_addr *addr)
 {
   struct prefix_ipv4 p;
 
@@ -270,7 +270,7 @@ bgp_node_match_ipv4 (struct bgp_table *table, struct in_addr *addr)
 
 #ifdef HAVE_IPV6
 struct bgp_node *
-bgp_node_match_ipv6 (struct bgp_table *table, struct in6_addr *addr)
+bgp_node_match_ipv6 (const struct bgp_table *table, struct in6_addr *addr)
 {
   struct prefix_ipv6 p;
 
@@ -285,7 +285,7 @@ bgp_node_match_ipv6 (struct bgp_table *table, struct in6_addr *addr)
 
 /* Lookup same prefix node.  Return NULL when we can't find route. */
 struct bgp_node *
-bgp_node_lookup (struct bgp_table *table, struct prefix *p)
+bgp_node_lookup (const struct bgp_table *table, struct prefix *p)
 {
   struct bgp_node *node;
 
@@ -305,7 +305,7 @@ bgp_node_lookup (struct bgp_table *table, struct prefix *p)
 
 /* Add node to routing table. */
 struct bgp_node *
-bgp_node_get (struct bgp_table *table, struct prefix *p)
+bgp_node_get (struct bgp_table *const table, struct prefix *p)
 {
   struct bgp_node *new;
   struct bgp_node *node;
@@ -405,7 +405,7 @@ bgp_node_delete (struct bgp_node *node)
 /* Get fist node and lock it.  This function is useful when one want
    to lookup all the node exist in the routing table. */
 struct bgp_node *
-bgp_table_top (struct bgp_table *table)
+bgp_table_top (const struct bgp_table *const table)
 {
   /* If there is no node in the routing table return NULL. */
   if (table->top == NULL)
@@ -499,7 +499,7 @@ bgp_route_next_until (struct bgp_node *node, struct bgp_node *limit)
 }
 
 unsigned long
-bgp_table_count (struct bgp_table *table)
+bgp_table_count (const struct bgp_table *table)
 {
   return table->count;
 }
index 0387c247f11e382ad2a5f83e64f6ea058ad4bdc3..dfa7e1f36c91e8e0a386e599ef584f7faa37e56b 100644 (file)
@@ -70,18 +70,18 @@ struct bgp_node
 extern struct bgp_table *bgp_table_init (afi_t, safi_t);
 extern void bgp_table_finish (struct bgp_table **);
 extern void bgp_unlock_node (struct bgp_node *node);
-extern struct bgp_node *bgp_table_top (struct bgp_table *);
+extern struct bgp_node *bgp_table_top (const struct bgp_table *const);
 extern struct bgp_node *bgp_route_next (struct bgp_node *);
 extern struct bgp_node *bgp_route_next_until (struct bgp_node *, struct bgp_node *);
-extern struct bgp_node *bgp_node_get (struct bgp_table *, struct prefix *);
-extern struct bgp_node *bgp_node_lookup (struct bgp_table *, struct prefix *);
+extern struct bgp_node *bgp_node_get (struct bgp_table *const, struct prefix *);
+extern struct bgp_node *bgp_node_lookup (const struct bgp_table *const, struct prefix *);
 extern struct bgp_node *bgp_lock_node (struct bgp_node *node);
-extern struct bgp_node *bgp_node_match (struct bgp_table *, struct prefix *);
-extern struct bgp_node *bgp_node_match_ipv4 (struct bgp_table *,
+extern struct bgp_node *bgp_node_match (const struct bgp_table *, struct prefix *);
+extern struct bgp_node *bgp_node_match_ipv4 (const struct bgp_table *,
                                          struct in_addr *);
 #ifdef HAVE_IPV6
-extern struct bgp_node *bgp_node_match_ipv6 (struct bgp_table *,
+extern struct bgp_node *bgp_node_match_ipv6 (const struct bgp_table *,
                                          struct in6_addr *);
 #endif /* HAVE_IPV6 */
-extern unsigned long bgp_table_count (struct bgp_table *);
+extern unsigned long bgp_table_count (const struct bgp_table *const);
 #endif /* _QUAGGA_BGP_TABLE_H */