[PATCH] udhcp[cd]: add -P switch for assigning server/client port

Jazz Yao-Tsung Wang jazzwang.tw at gmail.com
Thu Dec 27 02:38:46 PST 2007


Hi,

I also made a patch for 1.9.0.

The patch named busybox-1.8.1_udhcp.patch_v2 had been tested on 1.8.1 and 1.8.2
The patch named busybox-1.9.0_udhcp.patch_v3 had been tested on 1.9.0

Our team is working on Diskless Remote Boot Linux (DRBL) [1] and
open source cloning solution named 'Clonezilla' [2] especially for
education needs.
We found that there exists default DHCP server in some schools.
Users need a way to avoid their PC in classroom requesting IPs from
default DHCP server.
That's why we need a patch like this.

Any comments are welcome.
Happy New Year to all contributors of BusyBox.

DRBL/Clonezilla Co-Developer Jazz Yao-Tsung Wang

[1] DRBL - http://drbl.sf.net
[2] Clonezilla - http://clonezilla.sf.net

PS. This patch will increase 32 bytes after stripped.

~/busybox-1.9.0$ ./scripts/bloat-o-meter
../busybox_1.9.0_org_unstripped ../busybox_1.9.0_unstripped
function                                             old     new   delta
udhcpc_main                                         2611    2715    +104
udhcpd_main                                         1168    1267     +99
.rodata                                            32532   32564     +32
send_renew                                           129     145     +16
usage_messages                                      2086    2100     +14
static.udhcpc_longopts                               226     240     +14
send_packet                                           98     111     +13
send_selecting                                       134     142      +8
send_release                                         109     117      +8
send_discover                                        134     142      +8
send_decline                                          82      90      +8
get_raw_packet                                       330     337      +7
server_port                                            -       4      +4
client_port                                            -       4      +4
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 12/0 up/down: 339/0)            Total: 339 bytes
~/busybox-1.9.0$ ./scripts/bloat-o-meter ../busybox_1.9.0_org_stripped
../busybox_1.9.0_stripped
nm: ../busybox_1.9.0_org_stripped: no symbols
nm: ../busybox_1.9.0_stripped: no symbols
function                                             old     new   delta
.rodata                                            32532   32564     +32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 32/0)               Total: 32 bytes

2007/12/27, Jazz Yao-Tsung Wang <jazz at nchc.org.tw>:
> Hi,
>
> This patch adds -P switch both in udhcpc.c and udhcpd.c
> After stripped, it will increase 64 bytes.
>
> $ ./scripts/bloat-o-meter busybox_1.8.2_unstripped
> busybox_1.8.2_patched_unstripped
> function                                             old     new   delta
> udhcpc_main                                         2405    2507    +102
> udhcpd_main                                         1168    1267     +99
> .rodata                                            33428   33492     +64
> send_renew                                           129     145     +16
> usage_messages                                      2076    2091     +15
> static.udhcpc_longopts                               200     214     +14
> send_packet                                           98     111     +13
> send_selecting                                       134     142      +8
> send_release                                         109     117      +8
> send_discover                                        114     122      +8
> get_raw_packet                                       371     378      +7
> server_port                                            -       4      +4
> client_port                                            -       4      +4
> ------------------------------------------------------------------------------
> (add/remove: 2/0 grow/shrink: 11/0 up/down: 362/0)            Total: 362 bytes
>
> $ ./scripts/bloat-o-meter busybox_1.8.2_stripped busybox_1.8.2_patched_stripped
> nm: busybox_1.8.2_stripped: no symbols
> nm: busybox_1.8.2_patched_stripped: no symbols
> function                                             old     new   delta
> .rodata                                            33428   33492     +64
> ------------------------------------------------------------------------------
> (add/remove: 0/0 grow/shrink: 1/0 up/down: 64/0)               Total: 64 bytes
>
> Jazz Yao-Tsung Wang
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox-1.9.0_udhcp.patch_v3
Type: application/octet-stream
Size: 10553 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20071227/fef9ac07/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config-1.9.0
Type: application/octet-stream
Size: 21209 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20071227/fef9ac07/attachment-0003.obj 


More information about the busybox mailing list