Commit Graph

1149 Commits

Author SHA1 Message Date
Denis Vlasenko
1b16bdaebf networking/interface.c: reduce bss usage
function                                             old     new   delta
.rodata                                           158918  158950     +32
display_interfaces                                   133     153     +20
UNSPEC_print                                          56      68     +12
pr_ether                                              59      65      +6
static.proc_read                                       4       1      -3
interface_opt_a                                        4       1      -3
in_ether                                             139     136      -3
ifconfig_main                                       1296    1293      -3
if_readlist_proc                                     686     680      -6
ife_print                                           1350    1338     -12
do_if_print                                           46       -     -46
static.buff                                          369     264    -105
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 4/7 up/down: 70/-181)          Total: -111 bytes

# size busybox_old busybox_unstripped
   text    data     bss     dec     hex filename
 751073    3080   14800  768953   bbbb9 busybox_old
 751073    3048   14688  768809   bbb29 busybox_unstripped
2007-06-19 11:10:02 +00:00
Denis Vlasenko
7679145cfa ping: fix write-after-allocated-mem bug
ping: use monotonic_us instead of gettimeofday: smaller code and
      needs only 4 bytes in the packet
ping: display roundtrip times with 1/1000th of ms, not 1/10 ms precision.
wget: small optimization

function                                             old     new   delta
pingstats                                            243     259     +16
sendping6                                             98      93      -5
sendping4                                            183     178      -5
.rodata                                           129715  129707      -8
progressmeter                                        867     855     -12
unpack_tail                                          320     272     -48
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/5 up/down: 16/-78)            Total: -62 bytes
2007-06-18 08:55:57 +00:00
Denis Vlasenko
bd7bb299c0 wget: use monotonic_sec instead of gettimeofday
zcip: use monotonic_us instead of gettimeofday
udhcpcd: simpler, shorter random_xid()

function                                             old     new   delta
monotonic_sec                                          -      41     +41
find_pair                                            164     180     +16
run_list_real                                       2018    2028     +10
cmp_main                                             547     555      +8
collect_ctx                                          112     119      +7
singlemount                                         4544    4549      +5
time_main                                           1124    1128      +4
static.start_sec                                       -       4      +4
static.lastupdate_sec                                  -       4      +4
sock                                                   -       4      +4
read_package_field                                   253     257      +4
pick                                                  38      40      +2
get_next_line                                        145     147      +2
count_lines                                           59      61      +2
process_stdin                                        435     433      -2
xstrtoul_range_sfx                                   229     226      -3
static.initialized                                     4       1      -3
dhcprelay_main                                      1125    1122      -3
catcher                                              380     377      -3
arping_main                                         1969    1966      -3
s                                                      8       4      -4
cfg                                                    4       -      -4
static.lastupdate                                      8       -      -8
start                                                  8       -      -8
random_xid                                            95      33     -62
.rodata                                           129114  129050     -64
zcip_main                                           1731    1576    -155
progressmeter                                       1035     867    -168
------------------------------------------------------------------------------
(add/remove: 4/3 grow/shrink: 10/11 up/down: 113/-490)       Total: -377 bytes
2007-06-17 23:40:26 +00:00
Denis Vlasenko
459be35234 hwclock: size optimizations
libbb/time.c: new file, introducing monotonic_us()
pscan, traceroute, arping: use it instead of gettimeofday
ping, zcip: TODO

function                                             old     new   delta
monotonic_us                                           -      89     +89
find_pair                                            164     180     +16
.rodata                                           129747  129763     +16
refresh                                             1144    1152      +8
............
timeout                                                8       4      -4
static.start                                           8       4      -4
last                                                   8       4      -4
parse_conf                                          1303    1284     -19
time_main                                           1149    1124     -25
gettimeofday_us                                       39       -     -39
arping_main                                         2042    1969     -73
hwclock_main                                         594     501     -93
catcher                                              485     380    -105
traceroute_main                                     4300    4117    -183
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 8/11 up/down: 157/-562)        Total: -405 bytes
2007-06-17 19:09:05 +00:00
Denis Vlasenko
ea9e798004 arping: -i should be -I 2007-06-17 00:36:57 +00:00
Denis Vlasenko
ab47eeee6a forgot svn add... 2007-06-16 20:52:33 +00:00
Denis Vlasenko
a7825f269d make FEATURE_HAVE_RPC auto-selectable by mount and inetd sub-features 2007-06-16 13:56:51 +00:00
Denis Vlasenko
7b72fc1200 pscan: new applet (portscanner). ~1350 bytes. By Tito <farmatito@tiscali.it>
wget: lift 256 chars limitation on terminal width
2007-06-16 13:37:59 +00:00
Denis Vlasenko
1adf681e87 traceroute: stop using floating point needlessly; nuke useless assignment.
.rodata                                           129308  129312      +4
freehostinfo                                          35      29      -6
traceroute_main                                     4308    4300      -8
2007-06-14 07:47:52 +00:00
Denis Vlasenko
3ad5d0cbbe diff: shrink code (-85 bytes):
function                                             old     new   delta
fiddle_sum                                             8       -      -8
diffreg                                             2717    2690     -27
prepare                                              334     284     -50
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/2 up/down: 0/-85)             Total: -85 bytes

s/ATTRIBUTE_ALWAYS_INLINE/ALWAYS_INLINE/g
2007-06-12 20:54:54 +00:00
Denis Vlasenko
e8a0788b24 moved biggest stack buffers to malloc space, or made their size configurable
(8k of shell line edit buffer is an overkill)

# make ARCH=i386 bloatcheck
function                                             old     new   delta
read_line_input                                     3933    3967     +34
ifaddrlist                                           348     345      -3
do_loadfont                                          208     191     -17
edit_file                                            840     819     -21
.rodata                                           129112  129080     -32
uncompress                                          1305    1268     -37
loadfont_main                                        566     495     -71
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/6 up/down: 34/-181)          Total: -147 bytes
2007-06-10 15:08:44 +00:00
Denis Vlasenko
77e44d60e6 httpd: move data off bss.
httpd: do not realpath() for SCRIPT_FILENAME - it resolves symlinks
but it should not:

-                /* SCRIPT_FILENAME required by PHP in CGI mode */
-               if (!realpath(purl + 1, realpath_buff))
-                       goto error_execing_cgi;
-               setenv1("SCRIPT_FILENAME", realpath_buff);
+
+               /* SCRIPT_FILENAME required by PHP in CGI mode */
+               fullpath = concat_path_file(home_httpd, purl);
+               setenv1("SCRIPT_FILENAME", fullpath);
2007-06-09 23:49:05 +00:00
Denis Vlasenko
5c51a7ca52 nc: make connecting to IPv4 from IPv6-enabled hosts easier
(was requiring -s <local addr>)
2007-06-05 20:08:11 +00:00
Denis Vlasenko
8c1aaf3297 snprintf(... "%s"...) => safe_strncpy 2007-06-04 21:03:51 +00:00
Denis Vlasenko
821cc25f43 ping: stop using data/bss
function                                             old     new   delta
ping_main                                            375     392     +17
unpack_tail                                          317     320      +3
ping4                                                525     528      +3
ping6                                                772     773      +1
sendping6                                             99      98      -1
sendping4                                            184     183      -1
myid                                                   2       -      -2
sendping_tail                                        154     151      -3
tsum                                                   4       -      -4
tmin                                                   4       -      -4
tmax                                                   4       -      -4
source_lsa                                             4       -      -4
pingsock                                               4       -      -4
pingcount                                              4       -      -4
ntransmitted                                           4       -      -4
nrepeats                                               4       -      -4
nreceived                                              4       -      -4
if_index                                               4       -      -4
hostname                                               8       4      -4
dotted                                                 4       -      -4
datalen                                                4       -      -4
pingaddr                                              28       -     -28
rcvd_tbl                                             128       -    -128
------------------------------------------------------------------------------
(add/remove: 0/15 grow/shrink: 4/4 up/down: 24/-215)         Total: -191 bytes
   text    data     bss     dec     hex filename
 679835    2728   16736  699299   aaba3 busybox_old
 679851    2720   16536  699107   aaae3 busybox_unstripped
2007-06-04 10:33:48 +00:00
Denis Vlasenko
74324c8666 Audit bb_common_bufsiz usage, add script which looks for misuse.
tr: stop using globals needlessly.
code: -103 bytes
2007-06-04 10:16:52 +00:00
Denis Vlasenko
4e5f82c76f find_stray_communal_vars: script which finds communal variables
resize: remove globals var
mdev: remove globals var
2007-06-03 22:30:22 +00:00
Denis Vlasenko
9a7d38fe24 delete tons of extra #includes 2007-05-31 22:42:12 +00:00
Denis Vlasenko
fad2b86c9e use "glibc errno" trick not only for ash, but for entire busybox
(add/remove: 1/1 grow/shrink: 37/37 up/down: 139/-228)        Total: -89 bytes
2007-05-31 22:16:38 +00:00
Denis Vlasenko
4b924f3a5c whitespace fixes 2007-05-30 00:29:55 +00:00
Denis Vlasenko
1c9ad62d26 ping: fix wrong sign extension of packet id (bug 1373) 2007-05-27 00:53:41 +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
5a6aeddfa7 xpipe: introduce (saves ~170 bytes)
udhcp/signalpipe.c: use pipe instead of socketpair.
2007-05-26 16:44:20 +00:00
Bernhard Reutner-Fischer
6239b1f50a - fix typo in help text and fix punctuation 2007-05-26 11:59:01 +00:00
Denis Vlasenko
0fe67b16ce udhcp: socketpair can fail if AF_UNIX is not available (e.g. if module is not loaded).
Error out on that.
2007-05-24 12:19:56 +00:00
Denis Vlasenko
5b34083004 several *.c files:
move 'extern environ' up to the location of #includes
2007-05-17 23:02:14 +00:00
Denis Vlasenko
d46e6d1a55 fix trivial compile errors found by randomconfig run 2007-05-17 12:58:30 +00:00
Denis Vlasenko
a35958d4ad netstat: fix error in new -W option handling 2007-05-16 22:25:35 +00:00
Denis Vlasenko
418a7fb29b netstat: introduce -W: wide, ipv6-friendly output
netstat: shrink by ~500 bytes
(patch by Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>)
netstat: fix for bogus state value for raw sockets
2007-05-15 23:57:46 +00:00
Bernhard Reutner-Fischer
c2b3e370d6 - apply hunk that fixes an issue with (wrong?) dependencies. Initial notes were:
There is something wrong in the new buildsys: If one selects ip and has e.g.
  rule or route unset, ip still wants to build those.
  This fails (correctly) since rtnl_rttable_n2a and rtnl_rtrealm_n2a aren't
  available if they were turned off. TODO: Talk to vda about this
2007-05-15 09:33:32 +00:00
Denis Vlasenko
bf678d5423 tftp: explain "block# 0" codepath; report our decision to bail out to server
if blocksize option doesn't look good (it was a FIXME. +33 bytes code);
make code more readable.
2007-05-09 12:50:08 +00:00
Denis Vlasenko
a04561f5f7 tftp: code diet, and I think retransmits were broken.
function                                             old     new   delta
static.errcode_str                                     -      32     +32
tftp_main                                            359     345     -14
tftp_bb_error_msg                                     32       -     -32
.rodata                                           130931  130899     -32
tftp                                                1720    1558    -162
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 0/3 up/down: 32/-240)          Total: -208 bytes
2007-05-08 23:12:21 +00:00
Denis Vlasenko
6e6d331d97 udhcpc: stop deleting our own pidfile if we daemonize.
udhcp[cd]: stop using atexit magic fir pidfile removal.
2007-05-03 23:39:35 +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
Denis Vlasenko
088b959d00 "Unify base64 handling" is done, remove TODO 2007-04-18 21:14:46 +00:00
Denis Vlasenko
517d1aac7f ether-wake: save a few more bytes of code 2007-04-16 23:23:33 +00:00
Denis Vlasenko
198714c0dd ether-wake: close bug 1317. Reorder fuctions to avoid
forward refs while at it
2007-04-16 23:16:37 +00:00
Bernhard Reutner-Fischer
ab51bf4e28 - fix compilation when ENABLE_FEATURE_IP_RULE was off 2007-04-16 14:56:01 +00:00
Denis Vlasenko
16abcd90ae teach find_root_device to deal with /dev/ subdirs
(by "Kirill K. Smirnov" <lich@math.spbu.ru>)
2007-04-13 23:59:52 +00:00
Denis Vlasenko
87468857f6 style fixes 2007-04-13 23:22:00 +00:00
Denis Vlasenko
f7fcca4af7 sourse_route_list -> source_route_list 2007-04-13 22:07:21 +00:00
Bernhard Reutner-Fischer
c98c31783c - shrink iproute a bit (-200 bytes). Untested 2007-04-12 11:36:56 +00:00
Bernhard Reutner-Fischer
b290889f02 - add xsendto and use where appropriate; shrink iplink; sanitize libiproute a bit.
-916 byte
2007-04-12 11:34:39 +00:00
Denis Vlasenko
51742f4bb0 style fixes. No code changes 2007-04-12 00:32:05 +00:00
Denis Vlasenko
50f7f446ec bb_full_fd_action: remove potential xmalloc from NOFORK path
cat: stop using stdio.h opens
libbb: introduce & use open[3]_or_warn
function                                             old     new   delta
open3_or_warn                                          -      54     +54
bb_cat                                               115     144     +29
open_or_warn                                           -      25     +25
unlzma                                              2404    2412      +8
chattr_main                                          334     339      +5
xstrtoul_range_sfx                                   251     255      +4
telnet_main                                         1514    1510      -4
static.opt                                             4       -      -4
qgravechar                                           122     118      -4
fuser_add_pid                                         61      54      -7
fuser_add_inode                                      154     147      -7
writeFileToTarball                                  1542    1534      -8
refresh                                             1156    1148      -8
do_show                                              856     846     -10
read_leases                                          212     200     -12
setup_redirects                                      236     222     -14
iproute_list_or_flush                               1582    1568     -14
read_config                                          427     411     -16
write_leases                                         284     264     -20
hash_file                                            338     318     -20
copy_file                                           1760    1740     -20
do_iproute                                          2610    2588     -22
bb_full_fd_action                                    320     269     -51
open_to_or_warn                                      103      49     -54
fuser_main                                          1660    1596     -64
.rodata                                           131160  131096     -64
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 4/19 up/down: 125/-423)        Total: -298 bytes
2007-04-11 23:20:53 +00:00
Denis Vlasenko
6398cf477d style fixes, no code changes. 2007-04-11 17:04:29 +00:00
Bernhard Reutner-Fischer
12c96a64a4 - set the scope properly. Thanks to Jean Wolter, who wrote:
busybox ip and the original ip utility behave differently when setting
the following route (verified with ip route show using the original ip
utility):

   ip route add 10.0.0.138 dev eth0

Result for busybox ip:

       # ip route add 10.0.0.138 dev eth0
       # /usr/local/bin/ip route show
       10.0.0.138 dev eth0

Result for ip:

       # /usr/local/bin/ip route add 10.0.0.138 dev eth0
       #  /usr/local/bin/ip route show
       10.0.0.138 dev eth0  scope link

A following "ip route add default via 10.0.0.138" fails for busybox
ip, since the kernel can not find a route to 10.0.0.138 (it replies
with Network is unreachable).

The reasons seems to be that the original ip utility explicitly sets
the scope after parsing all parameters. This is missing in busybox,
the attached patch fixes this. I took this from the original iproute
sources and removed some variables, which are not needed for busybox.
2007-04-11 16:23:57 +00:00
Denis Vlasenko
473dae080a add more convenient defines for [NO]MMU:
"#ifndef BB_NOMMU" is a double negative
2007-04-11 07:04:23 +00:00