[Olsr-dev] [PATCH] changed return value of olsr_insert_routing_table to void

Christos Kallinteris (spam-protected)
Mon Apr 19 18:28:04 CEST 2010


From: Christos Kallinteris <(spam-protected)>

In files  routing_table.c and routing_table.h

changed:

struct rt_path *
olsr_insert_routing_table(const union olsr_ip_addr *dst, int plen, const
union olsr_ip_addr *originator, int origin)

to void olsr_insert_routing_table(etc.) and removed return values where
needed.

Nothing seems to check the returned value according to cscope. I ran the patched version for about 15 min on the UMIC virtual testbed here at RWTH-Aachen. Nothing seems broken. Did I miss something? Is this needed somewhere?
---
 src/routing_table.c |   11 +++++------
 src/routing_table.h |    2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/routing_table.c b/src/routing_table.c
index 46c0dca..bd41f59 100644
--- a/src/routing_table.c
+++ b/src/routing_table.c
@@ -590,10 +590,10 @@ olsr_rt_best(struct rt_entry *rt)
  *@param dst the destination
  *@param plen the prefix length
  *@param originator the originating router
- *
- *@return the new rt_path struct
+ *ck:
+ *@return void
  */
-struct rt_path *
+void
 olsr_insert_routing_table(const union olsr_ip_addr *dst, int plen, const union olsr_ip_addr *originator, int origin)
 {
 #if !defined REMOVE_LOG_DEBUG
@@ -608,7 +608,7 @@ olsr_insert_routing_table(const union olsr_ip_addr *dst, int plen, const union o
    * No bogus prefix lengths.
    */
   if (plen > 8 * (int)olsr_cnf->ipsize) {
-    return NULL;
+    return;
   }
 
   /*
@@ -633,7 +633,7 @@ olsr_insert_routing_table(const union olsr_ip_addr *dst, int plen, const union o
     rtp = olsr_alloc_rt_path(tc, &prefix, origin);
 
     if (!rtp) {
-      return NULL;
+      return;
     }
 
     OLSR_DEBUG(LOG_ROUTING, "RIB: add prefix %s/%d from %s\n",
@@ -646,7 +646,6 @@ olsr_insert_routing_table(const union olsr_ip_addr *dst, int plen, const union o
     rtp = rtp_prefix_tree2rtp(node);
   }
 
-  return rtp;
 }
 
 /**
diff --git a/src/routing_table.h b/src/routing_table.h
index a1c6655..d8f80de 100644
--- a/src/routing_table.h
+++ b/src/routing_table.h
@@ -247,7 +247,7 @@ olsr_get_nh(const struct rt_entry *rt)
 
 
 /* rt_path manipulation */
-struct rt_path *olsr_insert_routing_table(const union olsr_ip_addr *, const int, const union olsr_ip_addr *, const int);
+void olsr_insert_routing_table(const union olsr_ip_addr *, const int, const union olsr_ip_addr *, const int);
 void olsr_delete_routing_table(union olsr_ip_addr *, int, union olsr_ip_addr *, int);
 void olsr_insert_rt_path(struct rt_path *, struct tc_entry *, struct link_entry *);
 void olsr_update_rt_path(struct rt_path *, struct tc_entry *, struct link_entry *);
-- 
1.7.0





More information about the Olsr-dev mailing list