Commit Graph

404 Commits

Author SHA1 Message Date
Vladislav Grishenko
713e6d78e1 udhcpc: use more correct, and more importantly, more understandable BPF code
Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-14 04:50:30 +01:00
Denys Vlasenko
fbea220560 udhcpc: fix a problem with binary-encoded options
function                                             old     new   delta
attach_option                                        395     413     +18

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-06 18:00:58 +01:00
Denys Vlasenko
dd169e8468 eliminate aliasing warnings in traceroute.c and udhcp/socket.c
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-20 12:13:23 +01:00
Denys Vlasenko
df1689138e remove a few aliasing warnings
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-16 01:25:34 +01:00
Denys Vlasenko
dc7e5c46b0 libbb unicode: comment out usused function and unused parameter
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-01-11 13:08:28 +01:00
Denys Vlasenko
8993c3f260 udhcpc: document SIGUSRn effect in help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-25 06:21:54 +01:00
Denys Vlasenko
713d241852 dhcpd: reply with NAK to clients in INIT-REBOOT state w/o existing lease
We were not responding to them at all.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-28 21:51:44 +01:00
Denys Vlasenko
fa5e295600 dhcpd: smaller code: do not look for REQUESTED_IP twice
text    data     bss     dec     hex filename
 883235     936   17192  901363   dc0f3 busybox_old
 883219     936   17192  901347   dc0e3 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-28 01:10:51 +01:00
Denys Vlasenko
e4dcba1c10 *: whitespace fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-28 18:57:19 +02:00
Denys Vlasenko
0bb35e19a7 udhcpd: reduce stack usage by ~700 bytes. +28 bytes code size
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-21 12:33:10 +02:00
Denys Vlasenko
5d374e9b14 udhcpc: exit if iface disappeared; use correct MAC if it changes
function                                             old     new   delta
udhcpc_main                                         2560    2618     +58

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-20 22:26:38 +02:00
Denys Vlasenko
c72c1d7b31 udhcpc: reduce stack usage by de-inlining routines with on-stack pkt buf
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-20 22:08:16 +02:00
Denys Vlasenko
a5048fa386 udhcpc: periodically reread our ifindex and mac
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-20 21:38:29 +02:00
Denys Vlasenko
b3af65b95d udhcpc: emit maxsize option in all non-NAK type packets
Before, we were sending them only in DISCOVER packets.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-20 21:37:23 +02:00
Denys Vlasenko
2c3b71a0d2 dhcp: typo fix: UPD_DHCP_SIZE -> UDP_DHCP_SIZE
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-20 18:04:36 +02:00
Denys Vlasenko
c59e06e471 udhcpc: better help text
function                                             old     new   delta
packed_usage                                       27452   27486     +34

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-20 16:10:59 +02:00
Denys Vlasenko
d3c5ab703b udhcpc: remove now-unneeded definitions of vendor and client-id opts
function                                             old     new   delta
dhcp_optflags                                         68      64      -4

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-20 02:03:30 +02:00
Denys Vlasenko
1cbdc03411 udhcpc: remove -c CLIENTID, it is hard to use, -x 61:hexstring does the same better
function                                             old     new   delta
packed_usage                                       27802   27808      +6
static.udhcpc_longopts                               261     250     -11
udhcpc_main                                         2799    2780     -19
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 6/-30)             Total: -24 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-20 01:42:37 +02:00
Denys Vlasenko
9e244c7600 udhcpc: move usage text to .c file. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-20 01:38:56 +02:00
Denys Vlasenko
9ff50b8697 *: deinline SWAP_xE64 on 32-bit CPUs. Wins !90 bytes both on 32 and 64 bits
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-18 11:40:26 +02:00
Denys Vlasenko
b102e12253 *: use SWAP_BE64 instead of open-coding it
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-18 11:39:47 +02:00
Vladislav Grishenko
ad8def2d8a udhcpc: fix OPTION_IP_PAIR parsing
http://git.busybox.net/busybox/commit/?id=7d3a48a003cd645edfae2b404493688022
revealed incorrect OPTION_IP_PAIR implementation, which doesn't respect
option length and causes erroneous classful routes, composed from garbage
or first bytes from the next DHCP packet option.

Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-17 12:27:50 +02:00
Denys Vlasenko
c0f39b0fb2 dhcprelay: code shrink, and explain its workings a bit more
function                                             old     new   delta
sendto_ip4                                             -      55     +55
dhcprelay_main                                      1059     942    -117
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 55/-117)           Total: -62 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-06 01:45:24 +02:00
Vladislav Grishenko
7d3a48a003 udhcp: add support for 0x21 ROUTES and 0xf9 MS_STATIC_ROUTES options
Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-09-26 00:15:12 +02:00
Denys Vlasenko
0ef64bdb40 *: make GNU licensing statement forms more regular
This change retains "or later" state! No licensing _changes_ here,
only form is adjusted (article, space between "GPL" and "v2" and so on).

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-16 20:14:46 +02:00
Denys Vlasenko
58a15cd9d2 Fix a typo in config text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-07 14:02:26 +02:00
Jeremie Koenig
1d7266d3b5 mark Linux-specific configuration options
PLATFORM_LINUX is used as a dependency for applets or features
which require Linux-specific interfaces.

Signed-off-by: Jeremie Koenig <jk@jk.fr.eu.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-19 00:44:56 +02:00
Denys Vlasenko
243d1757d7 remove some dead assignments, add a TODO comment
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-04 04:26:55 +02:00
Denys Vlasenko
dd8adde386 *: introduce and use bb_unsetenv_and_free
function                                             old     new   delta
bb_unsetenv_and_free                                   -      17     +17
tcpudpsvd_main                                      1819    1810      -9
safe_setenv                                           58      47     -11
udhcp_run_script                                     630     616     -14
make_device                                         1683    1663     -20
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/4 up/down: 17/-54)            Total: -37 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-24 05:00:50 +02:00
Denys Vlasenko
d70e0e995e *: add INSERTs to *.src files where appropriate
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-08 12:15:11 +02:00
Denys Vlasenko
2f32bf8be6 remove defconfig. Now "make defconfig" simply uses defaults from Config.in
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-06 04:14:28 +02:00
Denys Vlasenko
da929a95aa mass renaming Kbuild -> Kbuild.src, Config.in -> Config.src
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-04 20:10:51 +02:00
Mike Frysinger
6db1373295 udhcpd: fix daemonize crash on nommu systems
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-06-04 13:24:50 -04:00
Denys Vlasenko
b8b72f02f0 dhcp: truncate packets instead of padding them to 574 bytes. closes bug 1849
function                                             old     new   delta
udhcp_send_raw_packet                                411     456     +45
udhcp_send_kernel_packet                             259     271     +12

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-31 00:45:09 +02:00
Denys Vlasenko
e58c6e2e13 dhcp: indicate IP network order in prototypes too
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-30 23:43:35 +02:00
Denys Vlasenko
b7d19cc400 dhcp: readability cleanups and small code shrink
function                                             old     new   delta
udhcp_run_script                                     654     617     -37

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-30 23:41:23 +02:00
Denys Vlasenko
fde3fb3009 udhcpd: fix hostname truncation bug 1663
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-02 14:17:07 +02:00
Denys Vlasenko
5ab6b0f563 udhcp: s/sipservers/sipsrv/ to match other similar option names
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-06 16:52:59 +02:00
Denys Vlasenko
f8fcc184b6 udhcpd: note missing sanity checks on INFORM message handling
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-04 22:36:34 +02:00
Denys Vlasenko
4f3aa51f9d udhcp: implement "raw" binary options. Closes bug 735
function                                             old     new   delta
allocate_tempopt_if_needed                             -      76     +76
udhcp_str2optset                                     351     415     +64
attach_option                                        380     398     +18
len_of_option_as_string                               11      12      +1
dhcp_option_lengths                                   11      12      +1
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 4/0 up/down: 160/0)             Total: 160 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-04 15:31:12 +02:00
Denys Vlasenko
c03602baa4 udhcp: s/dhcp_option/dhcp_optflag/g
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-04 15:28:49 +02:00
Denys Vlasenko
9c0ea86caa udhcpc: trivial shrink
function                                             old     new   delta
udhcpc_main                                         2801    2785     -16

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-04 02:12:03 +02:00
Denys Vlasenko
243ddcbc76 udhcpd: support decoding of option 120 "SIP servers". Closes bug 737
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-03 17:34:52 +02:00
Denys Vlasenko
8a659f6ff9 libbb: make index_in_substrings return -1 on ambiguous matches
function                                             old     new   delta
index_in_substrings                                   67      93     +26

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-03 00:52:16 +02:00
Denys Vlasenko
c8a2ab1023 dumpleases: better help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-28 00:02:20 +01:00
Denys Vlasenko
406bd14416 udhcpd: fix -v/-P mixup
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-27 23:24:57 +01:00
Denys Vlasenko
9107b63a7f udhcp: abort if we see unknown option, and show valid options if so
function                                             old     new   delta
udhcp_option_idx                                       -      77     +77
udhcp_str2optset                                     366     351     -15
udhcpc_main                                         2845    2801     -44
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/2 up/down: 77/-59)             Total: 18 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-27 23:23:41 +01:00
Denys Vlasenko
19158a837d unicode: s/FEATURE_ASSUME_UNICODE/UNICODE_SUPPORT, add UNICODE_USING_LOCALE
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-26 14:06:56 +01:00
Denys Vlasenko
385b4562e3 udhcp: cosmetic cleanups; one case of s/full_read/xread/
function                                             old     new   delta
dumpleases_main                                      632     623      -9

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-26 10:09:34 +01:00
Denys Vlasenko
7724c766bd udhcp: pass pointer to whole packet to "add option" functions
This is needed for "overflow option" support

function                                             old     new   delta
udhcp_find_option                                      -      34     +34
udhcp_add_binary_option                               94     106     +12
write_leases                                         227     223      -4
udhcp_init_header                                     86      82      -4
send_release                                         104      99      -5
init_packet                                           87      81      -6
add_client_options                                   160     154      -6
add_server_options                                   100      92      -8
udhcpd_main                                         1964    1954     -10
udhcpc_main                                         2859    2837     -22
find_option                                           34       -     -34
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 1/8 up/down: 46/-99)            Total: -53 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-26 09:32:09 +01:00