Commit Graph

255 Commits

Author SHA1 Message Date
Denys Vlasenko
ec2bef11a7 iplink: comment out include <net/if_packet.h>
iplink.c includes net/if_packet.h, which (on GLIBC)
only defines struct sockaddr_pkt. this struct is not
used anywhere in the code, and removing the #include
makes compilation succeed with musl libc.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-08-16 12:20:25 +02:00
Denys Vlasenko
2ead5316b4 iplink: fix build error (IFLA_VLAN_PROTOCOL defined before include)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-28 23:24:55 +02:00
Patrick McHardy
a7ecbed56b ip link: add VLAN support
function                                             old     new   delta
do_add_or_delete                                       -    1073   +1073
get_u16                                                -      62     +62
static.protocols                                       -      16     +16
do_iplink                                           1235    1232      -3
do_change                                            495       -    -495
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 0/1 up/down: 1151/-498)         Total: 653 bytes

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-15 05:16:13 +02:00
Denys Vlasenko
9b58fe9c0b ip: code shrink
function                                             old     new   delta
do_ipaddr                                             78      81      +3
do_iprule                                            140     139      -1
do_iptunnel                                          283     278      -5
iprule_modify                                        851     841     -10
ipaddr_modify                                       1293    1236     -57
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/4 up/down: 3/-73)             Total: -70 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-15 05:15:46 +02:00
Denys Vlasenko
60cb48ca50 whitespace cleanup. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-14 15:57:44 +01:00
Denys Vlasenko
5f10fdf1dd Fix compile failure in ll_proto.c
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-09-03 11:41:30 +02:00
Denys Vlasenko
405dafffbb ll_proto.c: code shrink
text    data     bss     dec     hex filename
    762       0       0     762     2fa ll_proto.o.old
    526       0       0     526     20e ll_proto.o

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-09-02 14:29:45 +02:00
Denys Vlasenko
b307eabf4d iplink: tweak includes to work on android
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-12 17:15:16 +02:00
Dan Fandrich
f533ec8767 *: simplify Ethernet header includes
Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-10 05:17:59 +02:00
Denys Vlasenko
cfbd31a7fb add include <sys/socket.h>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-17 23:18:15 +02:00
Stefan Seyfried
da4441c44f fix libiproute compile with kernel headers < 2.6.17
Signed-off-by: Stefan Seyfried <seife+dev@b1-systems.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-26 20:11:47 +01:00
Denys Vlasenko
3bb235c3b5 iproute: fix parsing and matching of of "short" IP addrs like 10/8
function                                             old     new   delta
print_route                                         1613    1813    +200
get_addr_1                                           209     258     +49
get_prefix                                           393     356     -37
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 249/-37)           Total: 212 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-23 01:20:44 +01:00
Denys Vlasenko
e3ece7878b fix trivial build failure
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-10 09:50:07 +01:00
Denys Vlasenko
f133471302 iproute: fix handling of "dev IFACE" selector
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-09 04:39:09 +01:00
Christian Hornung
3bbfb58bec ip: Fix command line option parsing of "ip route get ..."
I found and fixed a bug in the command line options parsing of "ip route get":
It was impossible to get any option other than the IP address
recognized correctly, and e.g. the command "ip route get connected"
just hung up infinitely in the options parsing loop instead of
printing an error message.

Signed-off-by: Christian Hornung <chhornung@googlemail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-04 08:59:42 +01:00
Denys Vlasenko
11872cab32 networking/*: remove superfluous comments
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-30 02:24:48 +02:00
Denys Vlasenko
fb132e4737 whitespace cleanup
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-29 11:46:52 +02: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
0004e99493 better shared strings trick
text	   data	    bss	    dec	    hex	filename
 861980	    441	   7540	 869961	  d4649	busybox_old
 861914	    441	   7540	 869895	  d4607	busybox_unstripped

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-01 12:01:17 +02:00
Denys Vlasenko
c71ec70616 iplink: another compat #ifndef/#define tweak
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-08-30 19:20:09 +02:00
Denys Vlasenko
b276e41835 ip: add a #define for older kernels
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-22 10:02:55 +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
ba2dcccd79 *: trailing empty lines removed
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-26 01:49:12 +02:00
Denys Vlasenko
2e9b5510d6 libiproute: code shrink by adding FAST_FUNC
function                                             old     new   delta
ipaddr_list_or_flush                                1282    1293     +11
ip_parse_common_args                                 153     151      -2
ip_main                                               53      50      -3
ip_do                                                 19      15      -4
do_iptunnel                                          985     980      -5
do_iprule                                            982     977      -5
do_iplink                                           1637    1631      -6
do_iproute                                          2105    2098      -7
do_ipaddr                                           1406    1398      -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/8 up/down: 11/-40)            Total: -29 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-24 23:27:38 +02:00
Natanael Copa
b78ac5a20e libnetlink: code shrink
function                                             old     new   delta
xrtnl_open                                            95      93      -2
parse_rtattr                                          87      85      -2
rtnl_close                                             9       -      -9
xrtnl_wilddump_request                               101      64     -37
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/3 up/down: 0/-50)             Total: -50 bytes

Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-23 01:31:24 +02:00
Denys Vlasenko
fd744519d1 ip a: fix SEGV if "dev IFACE" is not specified
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-04 03:55:43 +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
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
Denys Vlasenko
eb29e91dc6 trivial fixes: use uint8_t, not __u8; fix defconfig for fgconsole
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-27 13:35:04 +02:00
Bernhard Reutner-Fischer
c5f30c0df8 ip addr: shrink
function                                             old     new   delta
ipaddr_list_or_flush                                1254    1248      -6
ipaddr_modify                                       1299    1279     -20
.rodata                                           135249  135193     -56
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-82)             Total: -82 bytes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-05-25 18:48:33 +02:00
Bernhard Reutner-Fischer
cc4493a95c ip addr: unify parsing args
function                                             old     new   delta
do_ipaddr                                             87      84      -3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-3)               Total: -3 bytes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-05-25 18:48:33 +02:00
Bernhard Reutner-Fischer
1b3549875c ip rule: unify parsing args
function                                             old     new   delta
do_iprule                                             83     134     +51
print_rule                                           736     726     -10
iprule_list                                           73       -     -73
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/1 up/down: 51/-83)            Total: -32 bytes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-05-25 18:48:33 +02:00
Bernhard Reutner-Fischer
96913f9254 ip tunnel: unify parsing args; no obj-code changes
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-05-25 18:48:33 +02:00
Bernhard Reutner-Fischer
ab0e412937 ip link: add qlen
qlen had a variable but was not handled..

function                                             old     new   delta
do_iplink                                           1113    1261    +148
.rodata                                           135225  135249     +24
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 172/0)             Total: 172 bytes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-05-25 18:48:33 +02:00
Bernhard Reutner-Fischer
d148e484db iplink: shrink
function                                             old     new   delta
do_change                                            490     487      -3
ipaddr_list_link                                      18       -     -18
do_iplink                                           1169    1113     -56
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/2 up/down: 0/-77)             Total: -77 bytes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-05-25 18:48:33 +02:00
Bernhard Reutner-Fischer
6faebfa663 iplink: support add/delete
function                                             old     new   delta
do_change                                              -     490    +490
.rodata                                           135193  135225     +32
do_iplink                                           1146    1169     +23
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/0 up/down: 545/0)             Total: 545 bytes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-05-25 13:39:39 +02:00
Bernhard Reutner-Fischer
49ee8393f4 ipaddress: print OPERSTATEs and NO-CARRIER
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-05-25 10:25:52 +02:00
Denys Vlasenko
5342c3f310 clean up redundant, commented-out and misplaced includes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-01 15:09:44 +02:00
Denys Vlasenko
651a2697f7 *: merge some common strings
text   data    bss    dec    hexfilename
 838650   8009      0 846659  ceb43busybox_old
 838519   8009      0 846528  ceac0busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-23 16:25:17 +01:00
Denys Vlasenko
36659fda1f *: fix 1/4 remaining aliasing warnings
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-05 14:40:23 +01:00
Denys Vlasenko
6b9f163353 *: style fixes. no code changes (verified with objdump)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-28 02:24:24 +01:00
Denys Vlasenko
ffc4bced95 libiproute: eliminate unused fields in struct filter_t's; style fixes
function                                             old     new   delta
print_route                                         1603    1588     -15
iproute_list_or_flush                               1254    1230     -24
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-39)             Total: -39 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-26 11:03:16 +01:00
Denys Vlasenko
9037787eae *: fix places where we were still using malloc/realloc
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-08 09:07:50 +01:00
Denys Vlasenko
a355da0775 *: make 2 more "int argc"'s unused; more saved if !DESKTOP
function                                             old     new   delta
sync_main                                             18      20      +2
tty_main                                              90      87      -3
iprule_list                                           83      79      -4

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-04 13:16:08 +01:00
Denys Vlasenko
6331cf059c *: use "can't" instead of "cannot"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-13 09:08:27 +01:00
Denys Vlasenko
8131eea3dc *: introduce and use ffulsh_all()
function                                             old     new   delta
buffer_fill_and_print                                179     196     +17
fflush_all                                             -       9      +9
spawn                                                 87      92      +5
rtcwake_main                                         455     453      -2
...
alarm_intr                                            93      84      -9
readcmd                                             1072    1062     -10
bb_ask                                               345     333     -12
more_main                                            845     832     -13
flush_stdout_stderr                                   42      23     -19
xfflush_stdout                                        27       -     -27
flush_stderr                                          30       -     -30
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 2/50 up/down: 31/-397)         Total: -366 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-02 14:19:51 +01:00
Denys Vlasenko
d31575a3ae libiproute/*: code shrink
function                                             old     new   delta
ll_addr_a2n                                          181     178      -3
rtnl_rtntype_a2n                                     198     194      -4
ipaddr_modify                                       1309    1305      -4
print_addrinfo                                      1303    1298      -5
do_iplink                                           1137    1132      -5
print_route                                         1609    1603      -6
parse_args                                          1440    1434      -6
iproute_list_or_flush                               1261    1254      -7
rtnl_rttable_a2n                                      39      31      -8
rtnl_rtscope_a2n                                      39      31      -8
rtnl_rtrealm_a2n                                      39      31      -8
rtnl_rtprot_a2n                                       39      31      -8
rtnl_dsfield_a2n                                      39      31      -8
ll_type_n2a                                           78      70      -8
get_rt_realms                                        115     107      -8
print_tunnel                                         656     647      -9
rtnl_rttable_n2a                                      63      53     -10
rtnl_rtscope_n2a                                      63      53     -10
rtnl_rtrealm_n2a                                      63      53     -10
rtnl_rtntype_n2a                                     128     118     -10
rtnl_dsfield_n2a                                      71      61     -10
print_linkinfo                                       815     805     -10
ipaddr_list_or_flush                                1246    1235     -11
iproute_modify                                      1048    1036     -12
iprule_modify                                        866     851     -15
print_rule                                           765     738     -27
ll_addr_n2a                                          182     150     -32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/27 up/down: 0/-262)          Total: -262 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-13 17:58:24 +02:00
Denys Vlasenko
94466b8b8c libiproute: code and data shrink
function                                             old     new   delta
rtnl_a2n                                               -     126    +126
ll_remember_index                                    233     263     +30
find_by_index                                         26      36     +10
rtnl_rtprot_initialize                                66      70      +4
static.unit_chars                                      7       9      +2
rtnl_rttable_initialize                               73      75      +2
rtnl_rtscope_initialize                               83      85      +2
rtnl_rtrealm_initialize                               43      45      +2
rtnl_rtdsfield_initialize                             43      45      +2
rtnl_rttable_n2a                                      62      63      +1
rtnl_rtscope_n2a                                      62      63      +1
rtnl_rtrealm_n2a                                      62      63      +1
rtnl_dsfield_n2a                                      70      71      +1
ll_init_map                                           36      33      -3
make_human_readable_str                              262     258      -4
static.fmt                                            97      92      -5
static.fmt_tenths                                     10       -     -10
static.str                                            21       4     -17
static.res                                            20       -     -20
static.cache                                          24       4     -20
idxmap                                                64       4     -60
rtnl_rttable_a2n                                     154      39    -115
rtnl_rtscope_a2n                                     159      39    -120
rtnl_rtrealm_a2n                                     159      39    -120
rtnl_rtprot_a2n                                      159      39    -120
rtnl_dsfield_a2n                                     162      39    -123
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 12/11 up/down: 184/-737)       Total: -553 bytes
   text           data            bss            dec            hex        filename
 820376            445           7668         828489          ca449        busybox_old
 819950            445           7548         827943          ca227        busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-13 16:27:11 +02:00
Denys Vlasenko
adf922ec28 *: a few more NOINLINEs
function                                             old     new   delta
print_linkinfo                                         -     815    +815
do_msg                                                 -     783    +783
INET_setroute                                          -     757    +757
varvalue                                               -     746    +746
do_sem                                                 -     637    +637
inflate_codes                                          -     617    +617
INET6_setroute                                         -     491    +491
edir                                                   -     370    +370
sync_cursor                                            -     298    +298
update_utmp                                            -     246    +246
searchLines                                            -     165    +165
setup_alarm                                            -     144    +144
may_wakeup                                             -     101    +101
getNum                                               566     371    -195
refresh                                             1166     848    -318
rtcwake_main                                         809     479    -330
getty_main                                          2396    1921    -475
chpst_main                                          1373     746    -627
inflate_unzip_internal                              1335     567    -768
evalvar                                             1384     612    -772
ipaddr_list_or_flush                                2160    1246    -914
route_main                                          1585     245   -1340
ipcs_main                                           2523    1049   -1474
------------------------------------------------------------------------------
(add/remove: 13/0 grow/shrink: 0/10 up/down: 6170/-7213)    Total: -1043 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-08 14:35:37 +02:00
Denys Vlasenko
fd2dc53ba4 remove useless (unsigned >= 0) comparison
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-04 01:13:35 +02:00