]> git.puffer.fish Git - mirror/frr.git/commitdiff
[bgpd] remove useless check and return in bgp_config_write_damp
authorStephen Hemminger <stephen.hemminger@vyatta.com>
Sun, 17 Aug 2008 16:51:47 +0000 (17:51 +0100)
committerPaul Jakma <paul@quagga.net>
Fri, 22 Aug 2008 18:56:26 +0000 (19:56 +0100)
2008-08-17 Stephen Hemminger <stephen.hemminger@vyatta.com>

* bgp_damp.?: (bgp_config_write_damp) remove useless check
  of statically allocated config storage, and useless return
  value

Signed-off-by: Paul Jakma <paul@quagga.net>
bgpd/bgp_damp.c
bgpd/bgp_damp.h

index 5a7c9aaaac9fa052f0c939a6cab2ea7c76d75f8d..ba25f4d1ae4004bd94fe32b9e69e7948baa03961 100644 (file)
@@ -517,33 +517,28 @@ bgp_damp_disable (struct bgp *bgp, afi_t afi, safi_t safi)
   return 0;
 }
 
-int
+void
 bgp_config_write_damp (struct vty *vty)
 {
-  if (&bgp_damp_cfg)
-    {
-      if (bgp_damp_cfg.half_life == DEFAULT_HALF_LIFE*60
-         && bgp_damp_cfg.reuse_limit == DEFAULT_REUSE
-         && bgp_damp_cfg.suppress_value == DEFAULT_SUPPRESS
-         && bgp_damp_cfg.max_suppress_time == bgp_damp_cfg.half_life*4)
-       vty_out (vty, " bgp dampening%s", VTY_NEWLINE);
-      else if (bgp_damp_cfg.half_life != DEFAULT_HALF_LIFE*60
-              && bgp_damp_cfg.reuse_limit == DEFAULT_REUSE
-              && bgp_damp_cfg.suppress_value == DEFAULT_SUPPRESS
-              && bgp_damp_cfg.max_suppress_time == bgp_damp_cfg.half_life*4)
-       vty_out (vty, " bgp dampening %ld%s",
-                bgp_damp_cfg.half_life/60,
-                VTY_NEWLINE);
-      else
-       vty_out (vty, " bgp dampening %ld %d %d %ld%s",
-                bgp_damp_cfg.half_life/60,
-                bgp_damp_cfg.reuse_limit,
-                bgp_damp_cfg.suppress_value,
-                bgp_damp_cfg.max_suppress_time/60,
-                VTY_NEWLINE);
-      return 1;
-    }
-  return 0;
+  if (bgp_damp_cfg.half_life == DEFAULT_HALF_LIFE*60
+      && bgp_damp_cfg.reuse_limit == DEFAULT_REUSE
+      && bgp_damp_cfg.suppress_value == DEFAULT_SUPPRESS
+      && bgp_damp_cfg.max_suppress_time == bgp_damp_cfg.half_life*4)
+    vty_out (vty, " bgp dampening%s", VTY_NEWLINE);
+  else if (bgp_damp_cfg.half_life != DEFAULT_HALF_LIFE*60
+          && bgp_damp_cfg.reuse_limit == DEFAULT_REUSE
+          && bgp_damp_cfg.suppress_value == DEFAULT_SUPPRESS
+          && bgp_damp_cfg.max_suppress_time == bgp_damp_cfg.half_life*4)
+    vty_out (vty, " bgp dampening %ld%s",
+            bgp_damp_cfg.half_life/60,
+            VTY_NEWLINE);
+  else
+    vty_out (vty, " bgp dampening %ld %d %d %ld%s",
+            bgp_damp_cfg.half_life/60,
+            bgp_damp_cfg.reuse_limit,
+            bgp_damp_cfg.suppress_value,
+            bgp_damp_cfg.max_suppress_time/60,
+            VTY_NEWLINE);
 }
 
 #define BGP_UPTIME_LEN 25
index 37ed90bc668555668c6edd0ee464a38e8995d709..17c31cb99b9b3ac49f5fb94bb48a38ad6875ba76 100644 (file)
@@ -140,7 +140,7 @@ extern void bgp_damp_info_free (struct bgp_damp_info *, int);
 extern void bgp_damp_info_clean (void);
 extern char * bgp_get_reuse_time (unsigned int, char*, size_t);
 extern int bgp_damp_decay (time_t, int);
-extern int bgp_config_write_damp (struct vty *);
+extern void bgp_config_write_damp (struct vty *);
 extern void bgp_damp_info_vty (struct vty *, struct bgp_info *);
 extern char * bgp_damp_reuse_time_vty (struct vty *, struct bgp_info *);