<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/networking, branch 1_28_4</title>
<subtitle>A mirror of https://github.com/rmyorston/busybox-w32.git
</subtitle>
<id>https://git.lua4.win/busybox-w32/atom?h=1_28_4</id>
<link rel='self' href='https://git.lua4.win/busybox-w32/atom?h=1_28_4'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/'/>
<updated>2018-03-26T00:05:47+00:00</updated>
<entry>
<title>ssl_client: fix option parsing</title>
<updated>2018-03-26T00:05:47+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2018-03-20T10:41:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=2afdcc77ccdd60f2632d2ee79c47517536a14a07'/>
<id>urn:sha1:2afdcc77ccdd60f2632d2ee79c47517536a14a07</id>
<content type='text'>
The wrong character was used to indicate options taking an integer
parameter.

Signed-off-by: Ron Yorston &lt;rmy@pobox.com&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>tcpsvd: fix fallout from opt_complementary removal</title>
<updated>2018-03-11T22:04:05+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-03-11T22:02:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=c74f1d2cb48c6a9216ea901178e43c02ac7da0dc'/>
<id>urn:sha1:c74f1d2cb48c6a9216ea901178e43c02ac7da0dc</id>
<content type='text'>
   text	   data	    bss	    dec	    hex	filename
 933035	    473	   6836	 940344	  e5938	busybox_old
 933051	    473	   6836	 940360	  e5948	busybox_unstripped

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>udhcpd: clamp down huge auto_times to ~2M seconds, better EINTR poll handling</title>
<updated>2018-03-11T22:04:05+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-03-11T10:34:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=62b7083c13a9afc16b872367db93f8a775164343'/>
<id>urn:sha1:62b7083c13a9afc16b872367db93f8a775164343</id>
<content type='text'>
EINTR _should_ only happen on two signals we trap, and safe_poll
_should_ work here just fine, but there were kernel bugs where spurious EINTRs
happen (e.g. on ptrace attach). Be safe.

function                                             old     new   delta
udhcpd_main                                         1437    1468     +31

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>udhcpd: fix "not dying on SIGTERM"</title>
<updated>2018-03-10T18:41:54+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-03-10T18:01:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=39bf15ba3e5d5a0f04eab05d4675241961bb333d'/>
<id>urn:sha1:39bf15ba3e5d5a0f04eab05d4675241961bb333d</id>
<content type='text'>
Fixes:
	commit 52a515d18724bbb34e3ccbbb0218efcc4eccc0a8
	"udhcp: use poll() instead of select()"
	Feb 16 2017

udhcp_sp_read() is meant to check whether signal pipe indeed has some data to read.
In the above commit, it was changed as follows:

-	if (!FD_ISSET(signal_pipe.rd, rfds))
+	if (!pfds[0].revents)
		return 0;

The problem is, the check was working for select() purely by accident.
Caught signal interrupts select()/poll() syscalls, they return with EINTR
(regardless of SA_RESTART flag in sigaction). _Then_ signal handler is invoked.
IOW: they can't see any changes to fd state caused by signal haldler
(in our case, signal handler makes signal pipe ready to be read).

For select(), it means that rfds[] bit array is unmodified, bit of signal
pipe's read fd is still set, and the above check "works": it thinks select()
says there is data to read.

This accident does not work for poll(): .revents stays clear, and we do not
try reading signal pipe as we should. In udhcpd, we fall through and block
in socket read. Further SIGTERM signals simply cause socket read to be
interrupted and then restarted (since SIGTERM handler has SA_RESTART=1).

Fixing this as follows: remove the check altogether. Set signal pipe read fd
to nonblocking mode. Always read it in udhcp_sp_read().
If read fails, assume it's EAGAIN and return 0 ("no signal seen").

udhcpd avoids reading signal pipe on every recvd packet by looping if EINTR
(using safe_poll()) - thus ensuring we have correct .revents for all fds -
and calling udhcp_sp_read() only if pfds[0].revents!=0.

udhcpc performs much fewer reads (typically it sleeps &gt;99.999% of the time),
there is no need to optimize it: can call udhcp_sp_read() after each poll
unconditionally.

To robustify socket reads, unconditionally set pfds[1].revents=0
in udhcp_sp_fd_set() (which is before poll), and check it before reading
network socket in udhcpd.

TODO:
This might still fail: if pfds[1].revents=POLLIN, socket read may still block.
There are rare cases when select/poll indicates that data can be read,
but then actual read still blocks (one such case is UDP packets with
wrong checksum). General advise is, if you use a poll/select loop,
keep all your fds nonblocking.
Maybe we should also do that to our network sockets?

function                                             old     new   delta
udhcp_sp_setup                                        55      65     +10
udhcp_sp_fd_set                                       54      60      +6
udhcp_sp_read                                         46      36     -10
udhcpd_main                                         1451    1437     -14
udhcpc_main                                         2723    2708     -15
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/3 up/down: 16/-39)            Total: -23 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-14T16:38:40+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=f5b9a2267803bcb1dad5e902dcdfeefb65a112c3'/>
<id>urn:sha1:f5b9a2267803bcb1dad5e902dcdfeefb65a112c3</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>tls: fix hash calculations if client cert is requested and sent</title>
<updated>2018-02-14T16:38:40+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-02-06T12:33:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=112392232028fa2ce215043e7f9cf78f7ff74afe'/>
<id>urn:sha1:112392232028fa2ce215043e7f9cf78f7ff74afe</id>
<content type='text'>
Symptoms: connecting to
    openssl s_server -cert vsftpd.pem -port 990 -debug -cipher AES128-SHA
works, but with "-verify 1" option added it does not.

function                                             old     new   delta
tls_xread_record                                     474     499     +25
tls_handshake                                       1582    1607     +25
bad_record_die                                        98     110     +12
tls_run_copy_loop                                    282     293     +11
tls_xread_handshake_block                             58      51      -7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/1 up/down: 73/-7)              Total: 66 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>udhcpc6: fix ipv6prefix[_lease] envvar value in script invocation</title>
<updated>2018-02-14T16:38:29+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2018-01-16T15:00:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=277636670c583720580c452e90b73cc2a5b0357e'/>
<id>urn:sha1:277636670c583720580c452e90b73cc2a5b0357e</id>
<content type='text'>
Based on a patch by DannyAAM &lt;danny@saru.moe&gt;.

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>randomconfig fixes</title>
<updated>2017-12-31T16:30:02+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2017-12-31T16:30:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=82d1c1f84ae23793d81b50aa0a753ad7c4db4f51'/>
<id>urn:sha1:82d1c1f84ae23793d81b50aa0a753ad7c4db4f51</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>ntpd: do run the script at leat once in 11 minutes</title>
<updated>2017-12-26T19:19:37+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2017-12-26T19:19:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=36acc4631c94bb0f43ecaac5d61dc773ef773e91'/>
<id>urn:sha1:36acc4631c94bb0f43ecaac5d61dc773ef773e91</id>
<content type='text'>
function                                             old     new   delta
ntpd_main                                           1197    1226     +29

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>inetd: fix for running by non-root</title>
<updated>2017-11-09T15:19:42+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2017-11-09T15:19:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=2fee2bce6f9c67c0836598e340bee8ae2e980212'/>
<id>urn:sha1:2fee2bce6f9c67c0836598e340bee8ae2e980212</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
</feed>
