aboutsummaryrefslogtreecommitdiff
path: root/networking/ifupdown.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-06-25 10:55:35 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-06-25 10:55:35 +0000
commit80b8b39899a09c7516920cda5fd343b3086d4824 (patch)
treeaa9903fd6b64d19c5f640fa302272d85c92b204e /networking/ifupdown.c
parent1399282b47bb218132a554cbe5b2b0ce4dcc055f (diff)
downloadbusybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.tar.gz
busybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.tar.bz2
busybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.zip
Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms <wharms@bfs.de>)
Diffstat (limited to 'networking/ifupdown.c')
-rw-r--r--networking/ifupdown.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 2b748f11d..8843184bf 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -375,7 +375,7 @@ static const struct method_t methods6[] = {
375 375
376static const struct address_family_t addr_inet6 = { 376static const struct address_family_t addr_inet6 = {
377 "inet6", 377 "inet6",
378 sizeof(methods6) / sizeof(struct method_t), 378 ARRAY_SIZE(methods6),
379 methods6 379 methods6
380}; 380};
381#endif /* FEATURE_IFUPDOWN_IPV6 */ 381#endif /* FEATURE_IFUPDOWN_IPV6 */
@@ -471,8 +471,8 @@ static const struct dhcp_client_t ext_dhcp_clients[] = {
471static int dhcp_up(struct interface_defn_t *ifd, execfn *exec) 471static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
472{ 472{
473#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP 473#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
474 int i, nclients = sizeof(ext_dhcp_clients) / sizeof(ext_dhcp_clients[0]); 474 int i ;
475 for (i = 0; i < nclients; i++) { 475 for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) {
476 if (exists_execable(ext_dhcp_clients[i].name)) 476 if (exists_execable(ext_dhcp_clients[i].name))
477 return execute(ext_dhcp_clients[i].startcmd, ifd, exec); 477 return execute(ext_dhcp_clients[i].startcmd, ifd, exec);
478 } 478 }
@@ -490,8 +490,8 @@ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
490static int dhcp_down(struct interface_defn_t *ifd, execfn *exec) 490static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
491{ 491{
492#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP 492#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
493 int i, nclients = sizeof(ext_dhcp_clients) / sizeof(ext_dhcp_clients[0]); 493 int i ;
494 for (i = 0; i < nclients; i++) { 494 for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) {
495 if (exists_execable(ext_dhcp_clients[i].name)) 495 if (exists_execable(ext_dhcp_clients[i].name))
496 return execute(ext_dhcp_clients[i].stopcmd, ifd, exec); 496 return execute(ext_dhcp_clients[i].stopcmd, ifd, exec);
497 } 497 }
@@ -551,7 +551,7 @@ static const struct method_t methods[] = {
551 551
552static const struct address_family_t addr_inet = { 552static const struct address_family_t addr_inet = {
553 "inet", 553 "inet",
554 sizeof(methods) / sizeof(methods[0]), 554 ARRAY_SIZE(methods),
555 methods 555 methods
556}; 556};
557 557