[quagga-dev 11302] [PATCH] Making functions return proper return values in bgpd and other code cleanups

G.Balaji balajig81 at gmail.com
Wed May 21 12:06:58 BST 2014


bgp_vty_return() called in places wherever necessary to make the
calling places return proper values.

Signed-off-by: G.Balaji <balajig81 at gmail.com>
---
 bgpd/bgp_vty.c | 16 +++++++++-------
 lib/table.c    |  3 ---
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index bfa1f20..ae68d94 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -3201,21 +3201,22 @@ peer_weight_set_vty (struct vty *vty, const char *ip_str,
 
   ret = peer_weight_set (peer, weight);
 
-  return CMD_SUCCESS;
+  return bgp_vty_return (vty, ret);
 }
 
 static int
 peer_weight_unset_vty (struct vty *vty, const char *ip_str)
 {
   struct peer *peer;
+  int ret;
 
   peer = peer_and_group_lookup_vty (vty, ip_str);
   if (! peer)
     return CMD_WARNING;
 
-  peer_weight_unset (peer);
+  ret = peer_weight_unset (peer);
 
-  return CMD_SUCCESS;
+  return bgp_vty_return (vty, ret);
 }
 
 DEFUN (neighbor_weight,
@@ -3367,9 +3368,10 @@ peer_timers_connect_set_vty (struct vty *vty, const char *ip_str,
 
   ret = peer_timers_connect_set (peer, connect);
 
-  return CMD_SUCCESS;
+  return bgp_vty_return (vty, ret);
 }
 
+
 static int
 peer_timers_connect_unset_vty (struct vty *vty, const char *ip_str)
 {
@@ -3382,7 +3384,7 @@ peer_timers_connect_unset_vty (struct vty *vty, const char *ip_str)
 
   ret = peer_timers_connect_unset (peer);
 
-  return CMD_SUCCESS;
+  return bgp_vty_return (vty, ret);
 }
 
 DEFUN (neighbor_timers_connect,
@@ -3439,7 +3441,7 @@ peer_advertise_interval_vty (struct vty *vty, const char *ip_str,
   else
     ret = peer_advertise_interval_unset (peer);
 
-  return CMD_SUCCESS;
+  return bgp_vty_return (vty, ret);
 }
 
 DEFUN (neighbor_advertise_interval,
@@ -3489,7 +3491,7 @@ peer_interface_vty (struct vty *vty, const char *ip_str, const char *str)
   else
     ret = peer_interface_unset (peer);
 
-  return CMD_SUCCESS;
+  return bgp_vty_return (vty, ret);
 }
 
 DEFUN (neighbor_interface,
diff --git a/lib/table.c b/lib/table.c
index 19b5d1b..e16ee78 100644
--- a/lib/table.c
+++ b/lib/table.c
@@ -626,11 +626,8 @@ route_table_get_next_internal (const struct route_table *table,
 			       struct prefix *p)
 {
   struct route_node *node, *tmp_node;
-  u_char prefixlen;
   int cmp;
 
-  prefixlen = p->prefixlen;
-
   node = table->top;
 
   while (node)
-- 
1.9.1





More information about the Quagga-dev mailing list