[PATCH 0/2] udhcpc: optimized fill_envp (fixes TODO)

Martin Lewis martin.lewis.x84 at gmail.com
Tue Jun 23 20:25:07 UTC 2020


Up until now, udhcpc iterated over the received packet a few hundred times (!).
This patch series resolves the relevant TODO - iterating over the packet just once,
while also reducing binary size.

Tested against:
	* VMware's dhcp server
	* udhcpd
	* ISC's dhcpd

function                                             old     new   delta
udhcp_scan_options                                     -     203    +203
putenvp                                                -      39     +39
init_scan_state                                        -      24     +24
udhcp_get_option                                     200     107     -93
udhcp_run_script                                     963     722    -241
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 0/2 up/down: 266/-334)          Total: -68 bytes
   text	   data	    bss	    dec	    hex	filename
 981424	  16915	   1872	1000211	  f4313	busybox_old
 981356	  16915	   1872	1000143	  f42cf	busybox_unstripped


More information about the busybox mailing list