diff options
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_attr.c | 5 | ||||
-rw-r--r-- | bgpd/bgp_main.c | 4 | ||||
-rw-r--r-- | bgpd/bgp_open.c | 8 |
3 files changed, 7 insertions, 10 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; diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c index 0f1d4829..1ff1ac95 100644 --- a/bgpd/bgp_main.c +++ b/bgpd/bgp_main.c @@ -135,7 +135,7 @@ struct zebra_privs_t bgpd_privs = .vty_group = VTY_GROUP, #endif .caps_p = _caps_p, - .cap_num_p = sizeof(_caps_p)/sizeof(_caps_p[0]), + .cap_num_p = array_size(_caps_p), .cap_num_i = 0, }; @@ -422,7 +422,7 @@ main (int argc, char **argv) /* Initializations. */ srand (time (NULL)); - signal_init (master, Q_SIGC(bgp_signals), bgp_signals); + signal_init (master, array_size(bgp_signals), bgp_signals); zprivs_init (&bgpd_privs); cmd_init (1); vty_init (master); diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c index 0326d01b..d045dde5 100644 --- a/bgpd/bgp_open.c +++ b/bgpd/bgp_open.c @@ -187,8 +187,7 @@ static const struct message orf_type_str[] = { ORF_TYPE_PREFIX, "Prefixlist" }, { ORF_TYPE_PREFIX_OLD, "Prefixlist (old)" }, }; -static const int orf_type_str_max - = sizeof(orf_type_str)/sizeof(orf_type_str[0]); +static const int orf_type_str_max = array_size(orf_type_str); static const struct message orf_mode_str[] = { @@ -196,8 +195,7 @@ static const struct message orf_mode_str[] = { ORF_MODE_SEND, "Send" }, { ORF_MODE_BOTH, "Both" }, }; -static const int orf_mode_str_max - = sizeof(orf_mode_str)/sizeof(orf_mode_str[0]); +static const int orf_mode_str_max = array_size(orf_mode_str); static int bgp_capability_orf_entry (struct peer *peer, struct capability_header *hdr) @@ -449,7 +447,7 @@ static const struct message capcode_str[] = { CAPABILITY_CODE_REFRESH_OLD, "Route Refresh (Old)" }, { CAPABILITY_CODE_ORF_OLD, "ORF (Old)" }, }; -static const int capcode_str_max = sizeof(capcode_str)/sizeof(capcode_str[0]); +static const int capcode_str_max = array_size(capcode_str); /* Minimum sizes for length field of each cap (so not inc. the header) */ static const size_t cap_minsizes[] = |