Age | Commit message (Collapse) | Author |
|
This adds support for fwmark/fwmask in ip rule which is needed, for example, in
OpenWrt's mwan3. Masks are supported since Linux 2.6.19.
Fixes: https://bugs.busybox.net/show_bug.cgi?id=11621
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
parse_rtattr() was using tb[] array without initializing it.
Based on patch by Balaji Punnuru <balaji_punnuru@cable.comcast.com>
function old new delta
parse_rtattr 85 107 +22
print_route 1630 1617 -13
print_linkinfo 807 794 -13
iproute_get 835 822 -13
print_rule 680 665 -15
ll_remember_index 263 248 -15
print_addrinfo 1223 1197 -26
ipaddr_list_or_flush 1253 1223 -30
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/7 up/down: 22/-125) Total: -103 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
iproute.c: In function 'print_route':
iproute.c:85:9: error: 'RTA_TABLE' undeclared (first use in this function)
iproute.c:85:9: note: each undeclared identifier is reported only once for each function it appears in
iproute.c: In function 'iproute_modify':
iproute.c:467:36: error: 'RTA_TABLE' undeclared (first use in this function)
Fix it by partially #ifdef'ing the code added in b42107f21538e39d9a344376372f8261aed589b2
Signed-off-by: Eugene Rudoy <gene.devel@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
iprule_modify 816 887 +71
print_rule 610 680 +70
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 141/0) Total: 141 bytes
Signed-off-by: Stefan Tomanek <stefan.tomanek@wertarbyte.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Linux kernel, starting from 2.6.19 allows ip table ids to have 32-bit values.
In order to preserve compatibility, the old 8-bit field: rtm_table is still
in use when table id is lower than 256.
Add support for the 32-bit table id (RTA_TABLE attribute) in:
- ip route print
- ip route modify
- ip rule print
- ip rule modify
Add printing of table ids to ip route.
Changes are compatible with the mainline iproute2 utilities.
These changes are required for compatibility with ConnMan, which by default
uses table ids greater than 255.
function old new delta
print_route 1588 1637 +49
do_iproute 2187 2222 +35
do_iprule 955 987 +32
print_rule 617 630 +13
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 129/0) Total: 129 bytes
Signed-off-by: Lukasz Nowak <lnowak@tycoint.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
do_iprule 974 955 -19
rtnl_dump_request 173 146 -27
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-46) Total: -46 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
rt_addr_n2a 56 53 -3
print_addrinfo 1227 1178 -49
print_neigh 933 881 -52
print_rule 689 617 -72
print_tunnel 640 560 -80
print_route 1727 1588 -139
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/6 up/down: 0/-395) Total: -395 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
invarg(a,b) - "invalid argument", but how a and b enter the message?
invarg_1_to_2(a,b) is somewhat easier to read: "invalid argument 'a' to 'b'"
Audit of usage revealed a number of bad uses, with too long messages.
text data bss dec hex filename
938848 932 17448 957228 e9b2c busybox_old
938788 932 17448 957168 e9af0 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
function old new delta
rtnl_rtprot_a2n 31 88 +57
print_tunnel 647 640 -7
print_route 1865 1858 -7
print_linkinfo 820 812 -8
print_addrinfo 1241 1227 -14
rtnl_rttable_n2a 53 38 -15
rtnl_rtscope_n2a 53 38 -15
rtnl_rtrealm_n2a 53 38 -15
rtnl_dsfield_n2a 61 38 -23
rtnl_rtntype_n2a 118 89 -29
print_rule 724 689 -35
ipaddr_list_or_flush 1293 1253 -40
rtnl_rtprot_n2a 53 - -53
rtnl_rtprot_initialize 63 - -63
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 1/11 up/down: 57/-324) Total: -267 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
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>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
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>
|
|
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>
|
|
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>
|
|
function old new delta
evalcommand 1195 1209 +14
testcmd - 10 +10
printfcmd - 10 +10
echocmd - 10 +10
func_exec 270 276 +6
echo_dg 104 109 +5
store_nlmsg 85 89 +4
pseudo_exec_argv 195 198 +3
dotcmd 287 290 +3
machtime_stream 29 31 +2
discard_stream 24 26 +2
argstr 1299 1301 +2
killcmd 108 109 +1
evalfor 226 227 +1
daytime_stream 43 44 +1
run_list 2544 2543 -1
lookupvar 62 61 -1
ipaddr_modify 1310 1309 -1
...
parse_stream 2254 2245 -9
evalpipe 356 347 -9
collect_if 210 197 -13
read_opt 869 851 -18
handle_dollar 681 658 -23
print_addrinfo 1342 1303 -39
iterate_on_dir 156 59 -97
print_route 1709 1609 -100
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 12/130 up/down: 74/-767) Total: -693 bytes
text data bss dec hex filename
841748 467 7872 850087 cf8a7 busybox_old
841061 467 7872 849400 cf5f8 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
and other misc stuff
function old new delta
print_tunnel 660 656 -4
format_host 5 - -5
get_unsigned 70 54 -16
get_u32 70 54 -16
do_iplink 1173 1151 -22
get_prefix 417 393 -24
print_rule 800 771 -29
print_addrinfo 1374 1342 -32
print_route 1745 1709 -36
iprule_modify 905 866 -39
iproute_modify 1105 1048 -57
get_integer 70 - -70
parse_args 1684 1440 -244
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 0/11 up/down: 0/-594) Total: -594 bytes
text data bss dec hex filename
817378 476 7892 825746 c9992 busybox_old
816784 476 7892 825152 c9740 busybox_unstripped
|
|
|
|
|
|
to match normal iproute. No obj-code changes.
|
|
function old new delta
iprule_list 86 82 -4
print_rule 860 791 -69
ipaddr_list_or_flush 2484 2384 -100
print_addrinfo 1498 1292 -206
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-379) Total: -379 bytes
|
|
|
|
add "ip r flush cache" (however I'm unsure it is really valid syntax)
Add a few comments and stop mixing params and params' keywords.
|
|
function old new delta
find_pair 167 187 +20
static.families - 17 +17
die_must_be_on_off - 11 +11
...
on_off 33 22 -11
do_ipaddr 103 90 -13
do_iptunnel 1001 986 -15
iproute_list_or_flush 1237 1217 -20
static.ip_common_commands 43 22 -21
do_iproute 2217 2193 -24
parse_args 1444 1414 -30
ip_do 47 16 -31
do_iprule 994 963 -31
ip_main 153 113 -40
ipaddr_modify 1357 1305 -52
ipaddr_list_or_flush 2543 2490 -53
ip_parse_common_args 294 159 -135
------------------------------------------------------------------------------
(add/remove: 4/1 grow/shrink: 4/24 up/down: 85/-563) Total: -478 bytes
text data bss dec hex filename
775561 966 9236 785763 bfd63 busybox_old
775073 962 9236 785271 bfb77 busybox_unstripped
|
|
|
|
trylink: explain how to modify link and drastically decrease amount
of padding (unfortunately, needs hand editing ATM).
*: add ALIGN1 / ALIGN2 to global strings and arrays of bytes and shorts
size saving: 0.5k
|
|
which scans thru "abc\0def\0123\0\0" type strings. Saves 250 bytes.
text data bss dec hex filename
781266 1328 11844 794438 c1f46 busybox_old
781010 1328 11844 794182 c1e46 busybox_unstripped
|
|
text data bss dec hex filename
2544 0 0 2544 9f0 networking/libiproute/iprule.o.oorig
2356 0 0 2356 934 networking/libiproute/iprule.o
6481 0 0 6481 1951 networking/libiproute/ipaddress.o.oorig
6464 0 0 6464 1940 networking/libiproute/ipaddress.o
|
|
|
|
a bit.
-916 byte
|
|
Kill a few statics, made other globals smaller:
oneline is smallint, _SL_ is char
function old new delta
print_tunnel 693 731 +38
print_route 1775 1777 +2
print_addrinfo 1495 1497 +2
ipaddr_list_or_flush 2826 2828 +2
oneline 4 1 -3
_SL_ 4 1 -3
ipaddr_modify 1476 1472 -4
parse_address 124 119 -5
ip_parse_common_args 429 423 -6
on_off 53 46 -7
do_del_ioctl 113 106 -7
do_add_ioctl 120 113 -7
do_show 864 856 -8
iprule_list 157 148 -9
do_iptunnel 310 299 -11
do_add 143 126 -17
get_ctl_fd 95 76 -19
set_address 108 84 -24
ip_main 351 323 -28
static.ifr 32 - -32
parse_args 1992 1949 -43
iproute_list_or_flush 1673 1582 -91
do_iplink 1583 1485 -98
filter 280 - -280
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 4/18 up/down: 44/-702) Total: -658 bytes
|
|
|
|
- minor size- and readability tweaks while at it:
text data bss dec hex filename
2631 0 0 2631 a47 networking/libiproute/iprule.o.orig
2596 0 0 2596 a24 networking/libiproute/iprule.o
|
|
|
|
|
|
|
|
text data bss dec hex filename
2999 0 0 2999 bb7 networking/libiproute/iprule.o
|