summaryrefslogtreecommitdiff
path: root/bgpd/bgp_attr.c
diff options
context:
space:
mode:
authorBalaji.G <balajig81@gmail.com>2012-09-26 14:09:10 +0530
committerDavid Lamparter <equinox@opensourcerouting.org>2012-10-25 10:15:59 -0700
commit837d16ccbe0fca413f8927da6a34b1e97ccada8a (patch)
tree7aed5a517b619c03d11bf567f6a14cda6f8f5efe /bgpd/bgp_attr.c
parent655071f44aab42e89bcece3a93da456fdd0d913a (diff)
*: use array_size() helper macro
Use the array_size() helper macro. Replaces several instances of local macros with the same definition. Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_attr.c')
-rw-r--r--bgpd/bgp_attr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index 2d82acc2..cdc99ab3 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -62,7 +62,7 @@ static const struct message attr_str [] =
{ BGP_ATTR_AS4_AGGREGATOR, "AS4_AGGREGATOR" },
{ BGP_ATTR_AS_PATHLIMIT, "AS_PATHLIMIT" },
};
-static const int attr_str_max = sizeof(attr_str)/sizeof(attr_str[0]);
+static const int attr_str_max = array_size(attr_str);
static const struct message attr_flag_str[] =
{
@@ -72,8 +72,7 @@ static const struct message attr_flag_str[] =
/* bgp_attr_flags_diagnose() relies on this bit being last in this list */
{ BGP_ATTR_FLAG_EXTLEN, "Extended Length" },
};
-static const size_t attr_flag_str_max =
- sizeof (attr_flag_str) / sizeof (attr_flag_str[0]);
+static const size_t attr_flag_str_max = array_size(attr_flag_str);
static struct hash *cluster_hash;