<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/networking/libiproute/libnetlink.c, branch long_paths</title>
<subtitle>A mirror of https://github.com/rmyorston/busybox-w32.git
</subtitle>
<id>https://git.lua4.win/busybox-w32/atom?h=long_paths</id>
<link rel='self' href='https://git.lua4.win/busybox-w32/atom?h=long_paths'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/'/>
<updated>2019-07-02T09:35:03+00:00</updated>
<entry>
<title>libbb: reduce the overhead of single parameter bb_error_msg() calls</title>
<updated>2019-07-02T09:35:03+00:00</updated>
<author>
<name>James Byrne</name>
<email>james.byrne@origamienergy.com</email>
</author>
<published>2019-07-02T09:35:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=6937487be73cd4563b876413277a295a5fe2f32c'/>
<id>urn:sha1:6937487be73cd4563b876413277a295a5fe2f32c</id>
<content type='text'>
Back in 2007, commit 0c97c9d43707 ("'simple' error message functions by
Loic Grenie") introduced bb_simple_perror_msg() to allow for a lower
overhead call to bb_perror_msg() when only a string was being printed
with no parameters. This saves space for some CPU architectures because
it avoids the overhead of a call to a variadic function. However there
has never been a simple version of bb_error_msg(), and since 2007 many
new calls to bb_perror_msg() have been added that only take a single
parameter and so could have been using bb_simple_perror_message().

This changeset introduces 'simple' versions of bb_info_msg(),
bb_error_msg(), bb_error_msg_and_die(), bb_herror_msg() and
bb_herror_msg_and_die(), and replaces all calls that only take a
single parameter, or use something like ("%s", arg), with calls to the
corresponding 'simple' version.

Since it is likely that single parameter calls to the variadic functions
may be accidentally reintroduced in the future a new debugging config
option WARN_SIMPLE_MSG has been introduced. This uses some macro magic
which will cause any such calls to generate a warning, but this is
turned off by default to avoid use of the unpleasant macros in normal
circumstances.

This is a large changeset due to the number of calls that have been
replaced. The only files that contain changes other than simple
substitution of function calls are libbb.h, libbb/herror_msg.c,
libbb/verror_msg.c and libbb/xfuncs_printf.c. In miscutils/devfsd.c,
networking/udhcp/common.h and util-linux/mdev.c additonal macros have
been added for logging so that single parameter and multiple parameter
logging variants exist.

The amount of space saved varies considerably by architecture, and was
found to be as follows (for 'defconfig' using GCC 7.4):

Arm:     -92 bytes
MIPS:    -52 bytes
PPC:   -1836 bytes
x86_64: -938 bytes

Note that for the MIPS architecture only an exception had to be made
disabling the 'simple' calls for 'udhcp' (in networking/udhcp/common.h)
because it made these files larger on MIPS.

Signed-off-by: James Byrne &lt;james.byrne@origamienergy.com&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>ip: use rtnl_send_check() on flush commands, closes 6962</title>
<updated>2019-05-22T11:54:46+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2019-05-22T11:54:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=028c5aa18b5273c029f0278232d922ee1a164de6'/>
<id>urn:sha1:028c5aa18b5273c029f0278232d922ee1a164de6</id>
<content type='text'>
function                                             old     new   delta
rtnl_send_check                                        -     160    +160
xrtnl_wilddump_request                                64      66      +2
ipneigh_list_or_flush                                714     706      -8
rtnl_send                                             69       -     -69
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 1/1 up/down: 162/-77)            Total: 85 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>libbb: introduce and use bb_getsockname()</title>
<updated>2018-02-11T13:55:46+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-02-11T13:55:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=ba3b9dbf065438402d89655d7baefb0ccc6f0663'/>
<id>urn:sha1:ba3b9dbf065438402d89655d7baefb0ccc6f0663</id>
<content type='text'>
function                                             old     new   delta
bb_getsockname                                         -      18     +18
xrtnl_open                                            88      83      -5
do_iplink                                           1216    1209      -7
arping_main                                         1686    1668     -18
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 0/3 up/down: 18/-30)            Total: -12 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>ip: fix crash in "ip neigh show"</title>
<updated>2018-02-08T07:42:37+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-02-08T07:42:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=68ae54243cacee6beeb69842c7d562435acd5ad1'/>
<id>urn:sha1:68ae54243cacee6beeb69842c7d562435acd5ad1</id>
<content type='text'>
parse_rtattr() was using tb[] array without initializing it.

Based on patch by Balaji Punnuru &lt;balaji_punnuru@cable.comcast.com&gt;

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 &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>whitespace and comment format fixes, no code changes</title>
<updated>2017-10-05T12:40:24+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2017-10-05T12:40:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=ebe6d9d8758d36e03cf39b6587597c67ab778436'/>
<id>urn:sha1:ebe6d9d8758d36e03cf39b6587597c67ab778436</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>libnetlink: fix alignment of netlink messages</title>
<updated>2016-09-18T20:55:47+00:00</updated>
<author>
<name>Hauke Mehrtens</name>
<email>hauke@hauke-m.de</email>
</author>
<published>2016-09-16T20:40:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=4ff86df861069e51ee796bac4e8ead942f8985f5'/>
<id>urn:sha1:4ff86df861069e51ee796bac4e8ead942f8985f5</id>
<content type='text'>
A padding to align a message should not only be added between
different attributes of a netlink message, but also at the end of the
message to pad it to the correct size.

Without this patch the following command does not work and returns an
error code:
ip link add type nlmon

Without this ip from busybox sends this:

sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000},
	msg_namelen=12, msg_iov=[{iov_base={{len=45, ...},
		"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon"}, iov_len=45}],
	msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 45
return value: 2

The normal ip utile from iproute2 sends this:

sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000},
	msg_namelen=12, msg_iov=[{iov_base={{len=48, ...},
		"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon\0\0\0"}, iov_len=48}],
	msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 48
return value: 0

With this patch ip from busybox sends this:

sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000},
	msg_namelen=12, msg_iov=[{iov_base={{len=48, ...},
		"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon\0\0\0"}, iov_len=48}],
	msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 48
return value: 0

Signed-off-by: Hauke Mehrtens &lt;hauke@hauke-m.de&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>libiproute: eliminate some redundant zero stores</title>
<updated>2016-08-14T00:08:56+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2016-08-14T00:08:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=454829379951cb15d03d7e51ff292addde8548df'/>
<id>urn:sha1:454829379951cb15d03d7e51ff292addde8548df</id>
<content type='text'>
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 &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>ip: fix problem on mips64 n64 big endian musl systems</title>
<updated>2016-04-24T15:39:02+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2016-04-24T15:39:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=4ab372d49a6e82b0bf097dedb96d26330c5f2d5f'/>
<id>urn:sha1:4ab372d49a6e82b0bf097dedb96d26330c5f2d5f</id>
<content type='text'>
Use designated initializers for struct msghdr.
The struct layout is non-portable and musl libc does not match what busybox expects.

Signed-off-by: Szabolcs Nagy &lt;nsz@port70.net&gt;
Tested-by: Waldemar Brodkorb &lt;wbx@openadk.org&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>iproute: fix parsing and matching of of "short" IP addrs like 10/8</title>
<updated>2011-02-23T00:20:44+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2011-02-23T00:20:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=3bb235c3b50ca072e8bcfc20d5030f5460439c07'/>
<id>urn:sha1:3bb235c3b50ca072e8bcfc20d5030f5460439c07</id>
<content type='text'>
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 &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>iproute: fix handling of "dev IFACE" selector</title>
<updated>2011-02-09T03:39:09+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2011-02-09T03:39:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=f13347130245f9fb86ecb3b9c217d3c558a717a9'/>
<id>urn:sha1:f13347130245f9fb86ecb3b9c217d3c558a717a9</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
</feed>
