aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--networking/udhcp/dhcpc.c7
-rw-r--r--networking/udhcp/dhcpd.c12
2 files changed, 14 insertions, 5 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 */
435static NOINLINE int send_discover(uint32_t xid, uint32_t requested) 436static 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 */
463static NOINLINE int send_select(uint32_t xid, uint32_t server, uint32_t requested) 465static 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 */
503static int send_renew(uint32_t xid, uint32_t server, uint32_t ciaddr) 505/* NOINLINE: limit stack usage in caller */
506static 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 */
546static NOINLINE int send_decline(uint32_t xid, uint32_t server, uint32_t requested) 550static 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 */
591static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd) 596static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd)
592{ 597{
593 int bytes; 598 int bytes;
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c
index 043220de9..f0878652c 100644
--- a/networking/udhcp/dhcpd.c
+++ b/networking/udhcp/dhcpd.c
@@ -132,7 +132,8 @@ static uint32_t select_lease_time(struct dhcp_packet *packet)
132} 132}
133 133
134/* We got a DHCP DISCOVER. Send an OFFER. */ 134/* We got a DHCP DISCOVER. Send an OFFER. */
135static void send_offer(struct dhcp_packet *oldpacket, uint32_t static_lease_nip, struct dyn_lease *lease) 135/* NOINLINE: limit stack usage in caller */
136static NOINLINE void send_offer(struct dhcp_packet *oldpacket, uint32_t static_lease_nip, struct dyn_lease *lease)
136{ 137{
137 struct dhcp_packet packet; 138 struct dhcp_packet packet;
138 uint32_t lease_time_sec; 139 uint32_t lease_time_sec;
@@ -202,7 +203,8 @@ static void send_offer(struct dhcp_packet *oldpacket, uint32_t static_lease_nip,
202 send_packet(&packet, /*force_bcast:*/ 0); 203 send_packet(&packet, /*force_bcast:*/ 0);
203} 204}
204 205
205static void send_NAK(struct dhcp_packet *oldpacket) 206/* NOINLINE: limit stack usage in caller */
207static NOINLINE void send_NAK(struct dhcp_packet *oldpacket)
206{ 208{
207 struct dhcp_packet packet; 209 struct dhcp_packet packet;
208 210
@@ -212,7 +214,8 @@ static void send_NAK(struct dhcp_packet *oldpacket)
212 send_packet(&packet, /*force_bcast:*/ 1); 214 send_packet(&packet, /*force_bcast:*/ 1);
213} 215}
214 216
215static void send_ACK(struct dhcp_packet *oldpacket, uint32_t yiaddr) 217/* NOINLINE: limit stack usage in caller */
218static NOINLINE void send_ACK(struct dhcp_packet *oldpacket, uint32_t yiaddr)
216{ 219{
217 struct dhcp_packet packet; 220 struct dhcp_packet packet;
218 uint32_t lease_time_sec; 221 uint32_t lease_time_sec;
@@ -243,7 +246,8 @@ static void send_ACK(struct dhcp_packet *oldpacket, uint32_t yiaddr)
243 } 246 }
244} 247}
245 248
246static void send_inform(struct dhcp_packet *oldpacket) 249/* NOINLINE: limit stack usage in caller */
250static NOINLINE void send_inform(struct dhcp_packet *oldpacket)
247{ 251{
248 struct dhcp_packet packet; 252 struct dhcp_packet packet;
249 253