diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-21 12:33:10 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-21 12:33:10 +0200 |
commit | 0bb35e19a73ecbb9694172300a5530dbb8156bb4 (patch) | |
tree | a6f0e38398ffaf4db6bfab8ce97584359dbc3f83 /networking/udhcp/dhcpc.c | |
parent | 08187356d7f6a79d5fb4aa83b90476997e585ad3 (diff) | |
download | busybox-w32-0bb35e19a73ecbb9694172300a5530dbb8156bb4.tar.gz busybox-w32-0bb35e19a73ecbb9694172300a5530dbb8156bb4.tar.bz2 busybox-w32-0bb35e19a73ecbb9694172300a5530dbb8156bb4.zip |
udhcpd: reduce stack usage by ~700 bytes. +28 bytes code size
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r-- | networking/udhcp/dhcpc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index cef0ab957..78aabedf2 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c | |||
@@ -432,6 +432,7 @@ static int raw_bcast_from_client_config_ifindex(struct dhcp_packet *packet) | |||
432 | } | 432 | } |
433 | 433 | ||
434 | /* Broadcast a DHCP discover packet to the network, with an optionally requested IP */ | 434 | /* Broadcast a DHCP discover packet to the network, with an optionally requested IP */ |
435 | /* NOINLINE: limit stack usage in caller */ | ||
435 | static NOINLINE int send_discover(uint32_t xid, uint32_t requested) | 436 | static NOINLINE int send_discover(uint32_t xid, uint32_t requested) |
436 | { | 437 | { |
437 | struct dhcp_packet packet; | 438 | struct dhcp_packet packet; |
@@ -460,6 +461,7 @@ static NOINLINE int send_discover(uint32_t xid, uint32_t requested) | |||
460 | /* RFC 2131 3.1 paragraph 3: | 461 | /* RFC 2131 3.1 paragraph 3: |
461 | * "The client _broadcasts_ a DHCPREQUEST message..." | 462 | * "The client _broadcasts_ a DHCPREQUEST message..." |
462 | */ | 463 | */ |
464 | /* NOINLINE: limit stack usage in caller */ | ||
463 | static NOINLINE int send_select(uint32_t xid, uint32_t server, uint32_t requested) | 465 | static NOINLINE int send_select(uint32_t xid, uint32_t server, uint32_t requested) |
464 | { | 466 | { |
465 | struct dhcp_packet packet; | 467 | struct dhcp_packet packet; |
@@ -500,7 +502,8 @@ static NOINLINE int send_select(uint32_t xid, uint32_t server, uint32_t requeste | |||
500 | } | 502 | } |
501 | 503 | ||
502 | /* Unicast or broadcast a DHCP renew message */ | 504 | /* Unicast or broadcast a DHCP renew message */ |
503 | static int send_renew(uint32_t xid, uint32_t server, uint32_t ciaddr) | 505 | /* NOINLINE: limit stack usage in caller */ |
506 | static NOINLINE int send_renew(uint32_t xid, uint32_t server, uint32_t ciaddr) | ||
504 | { | 507 | { |
505 | struct dhcp_packet packet; | 508 | struct dhcp_packet packet; |
506 | 509 | ||
@@ -543,6 +546,7 @@ static int send_renew(uint32_t xid, uint32_t server, uint32_t ciaddr) | |||
543 | 546 | ||
544 | #if ENABLE_FEATURE_UDHCPC_ARPING | 547 | #if ENABLE_FEATURE_UDHCPC_ARPING |
545 | /* Broadcast a DHCP decline message */ | 548 | /* Broadcast a DHCP decline message */ |
549 | /* NOINLINE: limit stack usage in caller */ | ||
546 | static NOINLINE int send_decline(uint32_t xid, uint32_t server, uint32_t requested) | 550 | static NOINLINE int send_decline(uint32_t xid, uint32_t server, uint32_t requested) |
547 | { | 551 | { |
548 | struct dhcp_packet packet; | 552 | struct dhcp_packet packet; |
@@ -588,6 +592,7 @@ static int send_release(uint32_t server, uint32_t ciaddr) | |||
588 | } | 592 | } |
589 | 593 | ||
590 | /* Returns -1 on errors that are fatal for the socket, -2 for those that aren't */ | 594 | /* Returns -1 on errors that are fatal for the socket, -2 for those that aren't */ |
595 | /* NOINLINE: limit stack usage in caller */ | ||
591 | static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd) | 596 | static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd) |
592 | { | 597 | { |
593 | int bytes; | 598 | int bytes; |