Merge branch 'volatile/fix_warnings'
Thanks to Donald Sharp and Greg Troxel for providing feedback!
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c
index 1da1e69..05c30ff 100644
--- a/bgpd/bgp_damp.c
+++ b/bgpd/bgp_damp.c
@@ -639,3 +639,36 @@
return bgp_get_reuse_time (penalty, timebuf, len);
}
+
+int
+bgp_show_dampening_parameters (struct vty *vty, afi_t afi, safi_t safi)
+{
+ struct bgp *bgp;
+ bgp = bgp_get_default();
+
+ if (bgp == NULL)
+ {
+ vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING))
+ {
+ vty_out (vty, "Half-life time: %ld min%s",
+ damp->half_life / 60, VTY_NEWLINE);
+ vty_out (vty, "Reuse penalty: %d%s",
+ damp->reuse_limit, VTY_NEWLINE);
+ vty_out (vty, "Suppress penalty: %d%s",
+ damp->suppress_value, VTY_NEWLINE);
+ vty_out (vty, "Max suppress time: %ld min%s",
+ damp->max_suppress_time / 60, VTY_NEWLINE);
+ vty_out (vty, "Max supress penalty: %u%s",
+ damp->ceiling, VTY_NEWLINE);
+ vty_out (vty, "%s", VTY_NEWLINE);
+ }
+ else
+ vty_out (vty, "dampening not enabled for %s%s",
+ afi == AFI_IP ? "IPv4" : "IPv6", VTY_NEWLINE);
+
+ return CMD_SUCCESS;
+}
diff --git a/bgpd/bgp_damp.h b/bgpd/bgp_damp.h
index e1d319b..16fd367 100644
--- a/bgpd/bgp_damp.h
+++ b/bgpd/bgp_damp.h
@@ -144,4 +144,6 @@
extern const char * bgp_damp_reuse_time_vty (struct vty *, struct bgp_info *,
char *, size_t);
+extern int bgp_show_dampening_parameters (struct vty *vty, afi_t, safi_t);
+
#endif /* _QUAGGA_BGP_DAMP_H */
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 1ea4d21..34cb7c0 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -11920,6 +11920,14 @@
}
bgp = vty->index;
+
+ if (suppress < reuse)
+ {
+ vty_out (vty, "Suppress value cannot be less than reuse value %s",
+ VTY_NEWLINE);
+ return 0;
+ }
+
return bgp_damp_enable (bgp, bgp_node_afi (vty), bgp_node_safi (vty),
half, reuse, suppress, max);
}
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index 6a9892e..916dad9 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -84,9 +84,9 @@
/* OS X (Xcode as of 2014-12) is known not to define RT_ROUNDUP */
#ifdef __APPLE__
-#define ROUNDUP_TYPE long
-#else
#define ROUNDUP_TYPE int
+#else
+#define ROUNDUP_TYPE long
#endif
#define ROUNDUP(a) \