Commit Graph

142 Commits

Author SHA1 Message Date
Wade Berrier
142c5cb2a2 ifupdown.c: allow options to udhcpc to be configurable from .config
This allows more control over options that are passed to udhcpc
that are not configurable via /etc/network/interfaces.

Example: rather than quit when an initial lease isn't found,
you could use "--background" so that udhcpc keeps running and
continually attempts to get an ip.  That way, when you plug in
the ethernet after powering on the device, you'll still get an ip.
2008-11-14 21:18:45 +00:00
Denis Vlasenko
44d5dcebc6 iplink: accept shorthands for "address" keyword here:
"ip link set address 00:11:22:33:44:55"
ifupdown: use "addr" instead of "address"
2008-11-01 00:10:51 +00:00
Denis Vlasenko
6c4eb44113 ifupdown: fixes for shutdown of DHCP-managed interfaces
from Wade Berrier <wberrier AT gmail.com>
2008-08-19 23:02:23 +00:00
Denis Vlasenko
ee777c4e5f ifupdown: fixes for custom MAC address, by Wade Berrier <wberrier AT gmail.com> 2008-08-12 01:35:34 +00:00
Denis Vlasenko
5415c856ea libbb: [x]fopen_for_{read,write} introduced and used.
(by Valdimir)

function                                             old     new   delta
config_open2                                           -      41     +41
config_read                                          507     542     +35
find_pair                                            169     187     +18
fopen_for_write                                        -      14     +14
fopen_for_read                                         -      14     +14
find_main                                            406     418     +12
xfopen_for_write                                       -      10     +10
xfopen_for_read                                        -      10     +10
popstring                                            134     140      +6
parse_inittab                                        396     401      +5
next_token                                           923     928      +5
pack_gzip                                           1659    1661      +2
bb__parsespent                                       117     119      +2
fallbackSort                                        1719    1717      -2
evalvar                                             1376    1374      -2
qrealloc                                              36      33      -3
...
...
...
...
singlemount                                         4579    4569     -10
process_stdin                                        443     433     -10
patch_main                                          1111    1101     -10
ifupdown_main                                       2175    2165     -10
file_action_grep                                      90      80     -10
uuidcache_init                                       649     637     -12
hush_main                                            797     785     -12
read_config                                          230     217     -13
dpkg_main                                           3835    3820     -15
read_line_input                                     3134    3110     -24
sysctl_main                                          232     203     -29
config_open                                           40      10     -30
WARN_BAD_LINE                                         44       -     -44
login_main                                          1714    1575    -139
------------------------------------------------------------------------------
(add/remove: 5/1 grow/shrink: 8/74 up/down: 174/-737)        Total: -563 bytes
2008-07-21 23:05:26 +00:00
Denis Vlasenko
deeed59de0 libbb: introduce and use xrealloc_vector
function                                             old     new   delta
xrealloc_vector_helper                                 -      51     +51
create_list                                           84      99     +15
getopt_main                                          690     695      +5
passwd_main                                         1049    1053      +4
get_cached                                            85      89      +4
msh_main                                            1377    1380      +3
add_match                                             42      41      -1
read_lines                                           720     718      -2
grave                                               1068    1066      -2
fill_match_lines                                     143     141      -2
add_to_dirlist                                        67      65      -2
add_input_file                                        49      47      -2
act                                                  252     250      -2
fsck_main                                           2252    2246      -6
man_main                                             765     757      -8
bb_internal_initgroups                               228     220      -8
cut_main                                            1052    1041     -11
add_edge_to_node                                      55      43     -12
dpkg_main                                           3851    3835     -16
ifupdown_main                                       2202    2178     -24
sort_main                                            838     812     -26
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 5/15 up/down: 82/-124)          Total: -42 bytes
2008-07-08 05:14:36 +00:00
Denis Vlasenko
493829207c ifupdown: /etc/network/interfaces can have comments with leading blanks 2008-07-08 03:25:25 +00:00
Denis Vlasenko
a60f84ebf0 *: rename ATTRIBUTE_XXX to just XXX. 2008-07-05 09:18:54 +00:00
Denis Vlasenko
82604e9730 revert last two commits. vfork cannot be used in subroutine,
it trashes stack on return
2008-07-01 15:59:42 +00:00
Denis Vlasenko
3da5572bfa *: introduce and use xvfork()
function                                             old     new   delta
time_main                                           1052    1285    +233
crontab_main                                         623     856    +233
ifupdown_main                                       2202    2403    +201
xvfork                                                 -      20     +20
passwd_main                                         1049    1053      +4
grave                                               1068    1066      -2
script_main                                          935     921     -14
vfork_or_die                                          20       -     -20
vfork_compressor                                     206     175     -31
open_as_user                                         109       -    -109
popen2                                               218       -    -218
edit_file                                            910     690    -220
run_command                                          268       -    -268
------------------------------------------------------------------------------
(add/remove: 1/4 grow/shrink: 4/4 up/down: 691/-882)         Total: -191 bytes
2008-07-01 10:40:41 +00:00
Denis Vlasenko
6b06cb80be more of -Wall fixes from Cristian Ionescu-Idbohrn.
Some are fixing real bugs.

function                                             old     new   delta
syslogd_main                                         938     958     +20
get_signum                                           136     143      +7
obj_load                                             777     782      +5
recv_from_to                                         210     214      +4
get_next_block                                      1795    1799      +4
display_topmem_process_list                         1117    1121      +4
logread_main                                         484     487      +3
buffer_fill_and_print                                 73      76      +3
kill_main                                            687     689      +2
ll_remember_index                                    240     241      +1
do_stats                                             452     453      +1
if_readconf                                          166     165      -1
display_process_list                                1192    1191      -1
run_applet_and_exit                                  507     505      -2
print_signames                                        33      31      -2
parse_one_line                                      1092    1090      -2
find_out_spec                                         57      55      -2
add_ksymoops_symbols                                 421     419      -2
ash_main                                            1407    1402      -5
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 11/8 up/down: 54/-17)            Total: 37 bytes
2008-05-15 21:30:45 +00:00
Denis Vlasenko
2e4c3c4cc3 udhcpc: add -o "do not request options by default" switch
(by L. Gabriel Somlo <somlo AT cmu.edu>)

function                                             old     new   delta
udhcpc_main                                         2513    2554     +41
static.udhcpc_longopts                               226     247     +21
add_param_req_option                                 119     132     +13
packed_usage                                       23952   23964     +12
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 87/0)               Total: 87 bytes
2008-04-02 13:04:19 +00:00
Denis Vlasenko
8ee649a02e *: more uniform naming: s/xmalloc_getline/xmalloc_fgetline/ 2008-03-26 20:04:27 +00:00
Denis Vlasenko
b02cea1212 ifupdown: support for %retries% (L. Gabriel Somlo <somlo AT cmu.edu>) 2008-03-25 06:10:14 +00:00
Denis Vlasenko
c93b162248 patch: shrink by Pascal Bellard <pascal.bellard AT ads-lu.com> (-80 bytes)
*: removal of #include <getopt.h>
2008-03-23 22:55:25 +00:00
Denis Vlasenko
0764a7f72d ifupdown: make it NOMMU-capable 2008-03-19 16:24:17 +00:00
Denis Vlasenko
85c247161b *: fix fallout from -Wunused-parameter
function                                             old     new   delta
bbunpack                                             358     366      +8
passwd_main                                         1070    1072      +2
handle_incoming_and_exit                            2651    2653      +2
getpty                                                88      86      -2
script_main                                          975     972      -3
inetd_main                                          2036    2033      -3
dname_enc                                            377     373      -4
make_new_session                                     474     462     -12
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/5 up/down: 12/-24)            Total: -12 bytes
   text    data     bss     dec     hex filename
 797429     658    7428  805515   c4a8b busybox_old
 797417     658    7428  805503   c4a7f busybox_unstripped
2008-03-17 09:04:04 +00:00
Denis Vlasenko
68404f13d4 *: add -Wunused-parameter; fix resulting breakage
function                                             old     new   delta
procps_scan                                         1265    1298     +33
aliascmd                                             278     283      +5
parse_file_cmd                                       116     120      +4
dname_enc                                            373     377      +4
setcmd                                                90      93      +3
execcmd                                               57      60      +3
count_lines                                           72      74      +2
process_command_subs                                 340     339      -1
test_main                                            409     407      -2
mknod_main                                           179     177      -2
handle_incoming_and_exit                            2653    2651      -2
argstr                                              1312    1310      -2
shiftcmd                                             131     128      -3
exitcmd                                               46      43      -3
dotcmd                                               297     294      -3
breakcmd                                              86      83      -3
evalpipe                                             353     349      -4
evalcommand                                         1180    1176      -4
evalcmd                                              109     105      -4
send_tree                                            374     369      -5
mkfifo_main                                           82      77      -5
evalsubshell                                         152     147      -5
typecmd                                               75      69      -6
letcmd                                                61      55      -6
add_cmd                                             1190    1183      -7
main                                                 891     883      -8
ash_main                                            1415    1407      -8
parse_stream                                        1377    1367     -10
alloc_procps_scan                                     55       -     -55
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 7/21 up/down: 54/-148)          Total: -94 bytes
   text    data     bss     dec     hex filename
 797195     658    7428  805281   c49a1 busybox_old
 797101     658    7428  805187   c4943 busybox_unstripped
2008-03-17 09:00:54 +00:00
Denis Vlasenko
3718832a15 *: more readable handling of pipe fds. No code changes. 2008-02-16 13:20:56 +00:00
Denis Vlasenko
1e18f1bab3 ifupdowm: shrink
ifupdown_main                                       2170    2459    +289
find_iface_state                                      57      56      -1
next_word                                             63      58      -5
popen2                                               350       -    -350
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/2 up/down: 289/-356)          Total: -67 bytes
2008-02-16 13:19:19 +00:00
Denis Vlasenko
cd5c61cd3b ifupdown: code shrink
function                                             old     new   delta
next_word                                             78      63     -15
ifupdown_main                                       2381    2170    -211
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-226)           Total: -226 bytes
2008-02-15 16:20:26 +00:00
Denis Vlasenko
fb0eba706c libbb: introduce and use safe_waitpid (loops in EINTR)
*: use more approproate (shorter) versions of wait()

function                                             old     new   delta
safe_waitpid                                           -      48     +48
wait_any_nohang                                        -      17     +17
send_tree                                            365     369      +4
processorstop                                        432     435      +3
text_yank                                            110     108      -2
make_human_readable_str                              202     200      -2
crond_main                                          1368    1366      -2
handle_sigchld                                        49      43      -6
reapchild                                            166     159      -7
custom                                               260     250     -10
checkscript                                          191     177     -14
wait_nohang                                           17       -     -17
wait_pid                                              43       -     -43
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 2/7 up/down: 72/-103)           Total: -31 bytes
2008-01-02 19:55:04 +00:00
Denis Vlasenko
ff2b6d2185 logread: eliminate usage of data/bss
ifup: don't remove virtual iface prefixes (eth0:0)

function                                             old     new   delta
shbuf                                                  4       -      -4
SMrup                                                  6       -      -6
SMrdn                                                 12       -     -12
static.label_buf                                      20       4     -16
get_var                                              158     140     -18
------------------------------------------------------------------------------
(add/remove: 0/3 grow/shrink: 0/2 up/down: 0/-56)             Total: -56 bytes
   text    data     bss     dec     hex filename
 783501     962    9260  793723   c1c7b busybox_old
 783483     942    9244  793669   c1c45 busybox_unstripped
2007-11-23 03:39:45 +00:00
Denis Vlasenko
9b49a5ed85 add -fvisibility=hidden to CC flags, mark XXX_main functions
EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
2007-10-11 10:05:36 +00:00
Bernhard Reutner-Fischer
e747f62ed6 - mark TODO: use index_in_str_array() 2007-10-06 20:47:53 +00:00
Denis Vlasenko
4daad9004d introduce bb_putchar(). saves ~1800 on uclibc (less on glibc). 2007-09-27 10:20:47 +00:00
Denis Vlasenko
0beaff8c19 update Glenn McGrath's email address 2007-09-21 13:16:32 +00:00
Denis Vlasenko
fe7cd642b0 don't pass argc in getopt32, it's superfluous
(add/remove: 0/0 grow/shrink: 12/131 up/down: 91/-727) Total: -636 bytes
   text    data     bss     dec     hex filename
 773469    1058   11092  785619   bfcd3 busybox_old
 772644    1058   11092  784794   bf99a busybox_unstripped
2007-08-18 15:32:12 +00:00
Denis Vlasenko
856be770a6 assorted fixes for breakage found by randomconfig 2007-08-17 08:29:48 +00:00
Denis Vlasenko
1caca34aa6 start_stop_daemon: NOMMU fixes, round 2 by Alex Landau <landau_alex@yahoo.com>
dhcpc: fixed "ifupdown + udhcpc_without_pidpile_creation" bug
2007-08-02 10:14:29 +00:00
Denis Vlasenko
6cd84dac84 Three patches from FreeWRT people 2007-07-21 14:57:54 +00:00
Denis Vlasenko
2a86a61c27 ifup/ifdown: make location of ifstate configurable 2007-07-19 21:49:30 +00:00
Denis Vlasenko
a48369183b ifupdown: kill -TERM is default, so drop -TERM
ifupdown: ferror() does not set errno, don't use perror
ifupdown: make netmask parsing smaller and more strict
(was accepting 255.0.255.0, 255.1234.0.0 etc...)

function                                             old     new   delta
count_bits                                            36       -     -36
execute                                             2573    2535     -38
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-74)             Total: -74 bytes
   text    data     bss     dec     hex filename
 684204    2744   14000  700948   ab214 busybox_old
 684132    2744   14000  700876   ab1cc busybox_unstripped
2007-07-03 08:26:24 +00:00
Denis Vlasenko
80b8b39899 Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms <wharms@bfs.de>) 2007-06-25 10:55:35 +00:00
Denis Vlasenko
4b924f3a5c whitespace fixes 2007-05-30 00:29:55 +00:00
Denis Vlasenko
b6adbf1be2 usage.c: remove reference to busybox.h
*: s/include "busybox.h"/include "libbb.h"
2007-05-26 19:00:18 +00:00
Denis Vlasenko
f92df58d3d ifupdown: small optimization (avoid doing useless work if we are
not going to update state file)
2007-05-02 22:22:23 +00:00
Denis Vlasenko
eda43d7f45 ifupdown: mke it possible to use DHCP clients different from udhcp. 2007-05-02 22:04:38 +00:00
Denis Vlasenko
bd100b7478 ifupdown: reread state file before rewriting it.
Fixes "ifup started another ifup" state corruption bug.
Patch by Natanael Copa <natanael.copa@gmail.com>.
2007-05-02 21:38:44 +00:00
Bernhard Reutner-Fischer
16deb86746 - very minor size tweak.
TODO: mv to globals, config-out non-busybox dhcp client stuff, reduce string bloat, etc
   text    data     bss     dec     hex filename
   7543       0      28    7571    1d93 networking/ifupdown.o.orig
   7515       0      28    7543    1d77 networking/ifupdown.o
2007-03-19 19:54:56 +00:00
Denis Vlasenko
2b52b2797b ifupdown: do not complain if !/var/run/ifstate 2007-03-09 22:48:08 +00:00
Denis Vlasenko
8e858e2700 clean up accumulated whitespace damage 2007-03-07 09:35:43 +00:00
Denis Vlasenko
c115fdbc80 ifupdown: code to deconstruct the state_list gracefully
(patch by Gabriel L. Somlo <somlo@cmu.edu>)
2007-03-06 22:53:10 +00:00
Denis Vlasenko
1d76f439da EXEC_PREFER_APPLETS support by Gabriel L. Somlo <somlo@cmu.edu> 2007-02-06 01:20:12 +00:00
Denis Vlasenko
06af216528 suppress warnings about easch <applet>_main() having
no preceding prototype
2007-02-03 17:28:39 +00:00
Denis Vlasenko
89ef65f024 preparatory patch for -Wwrite-strings #5 2007-01-29 23:43:18 +00:00
Denis Vlasenko
ab2aea4447 preparatory patch for -Wwrite-strings #4 2007-01-29 22:51:58 +00:00
Denis Vlasenko
b95636c52f remove casts from xmalloc() 2006-12-19 23:36:04 +00:00
Denis Vlasenko
2375d75f32 ifupdown: do not print and/or execute empty commands (""). 2006-12-19 23:15:46 +00:00
Denis Vlasenko
8cd1a288fa ifupdown: parse() returning NULL and returning "" is not the same,
it turned out! wow... okay, fixing my buglet...
2006-12-19 23:01:33 +00:00