Commit Graph

2337 Commits

Author SHA1 Message Date
Michel Stam
9f41271f3c udhcpd: add option for tweaking arpping
Some clients have a very short timeout for sending the DHCP
DISCOVER, shorter than the arpping timeout of 2000 milliseconds
that udhcpd uses by default.

This patch allows tweaking the timeout, or disabling of arpping
altogether, at the risk of handing out addresses which are
already in use.

function                                             old     new   delta
udhcpd_main                                         1460    1501     +41
udhcpc_main                                         2814    2851     +37
packed_usage                                       29957   29974     +17
arpping                                              477     493     +16
find_free_or_expired_nip                             161     174     +13
send_offer                                           285     292      +7
nobody_responds_to_arp                                85      89      +4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 7/0 up/down: 135/0)             Total: 135 bytes

Signed-off-by: Michel Stam <m.stam@fugro.nl>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-10-30 11:59:04 +01:00
Miroslav Lichvar
760d035699 ntpd: calculate offset to jitter ratio before updating jitter
The offset to jitter ratio is now calculated before updating
jitter to make the test more sensitive.

function                                             old     new   delta
ntp_init                                             460     474     +14
update_local_clock                                   752     764     +12
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 26/0)               Total: 26 bytes

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-10-05 03:11:53 +02:00
Miroslav Lichvar
b434ce7069 ntpd: don't stay at short polling interval
To avoid polling servers frequently slowly increase the interval up
to BIGPOLL when
- no replies are received from a peer
- no source can be selected
- peer claims to be unsynchronized (e.g. we are polling it too
  frequently)

When recv() returns with an error, drop code to try to continue
on network errors: I'm not convinced those cases happen in real life.

function                                             old     new   delta
recv_and_process_peer_pkt                            919     838     -81

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-10-02 17:24:34 +02:00
Denys Vlasenko
d3fe960271 ntpd: be less eager to use shorter poll intervals
* on step, poll interval drops to 8.5 mins instead of 32 seconds
* on total loss of all replies (no replies from any peer
  for last 8 requests), also drop poll interval to 8.5 mins
  instead of 32 seconds
* on send abd recv errors, RETRY_INTERVAL is now 32 seconds,
  not 5 seconds
* on timing out listening to reply, instead of unconditional
  shortening poll interval by x4, clamp it to NOREPLY_INTERVAL
  (512 seconds)
* if a largish offset is seen, clamp nexp poll interval
  to 128 seconds, not 64 seconds

function                                             old     new   delta
clamp_pollexp_and_set_MAXSTRAT                         -      37     +37
recv_and_process_peer_pkt                            861     869      +8
poll_interval                                         52      48      -4
update_local_clock                                   762     752     -10
ntpd_main                                           1063    1050     -13
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/3 up/down: 45/-27)             Total: 18 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-27 22:56:09 +02:00
Miroslav Lichvar
590a22cf8d ntpd: split out poll adjusting code
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-24 15:37:17 +02:00
Miroslav Lichvar
fb143f783d ntpd: don't wait for good offset before disabling burst mode
The burst mode needs to be stopped even when no replies are received.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-24 15:21:18 +02:00
Denys Vlasenko
7666fa1d02 ftpd: make LIST command show dotfiles too
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-15 23:35:58 +02:00
Denys Vlasenko
4eb1e425fe tftpd: tweak HP PA-RISC firmware bug compatibility
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-04 12:24:03 +02:00
Denys Vlasenko
67e01fecce tftpd: support full 512-byte requests
Some HP PA-RISC firmware always sends fixed 512-byte requests,
with trailing garbage.

function                                             old     new   delta
tftpd_main                                           578     572      -6

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-03 18:35:38 +02:00
Florian Fainelli
6ff0551157 ping: add -p to specify data pattern
function                                             old     new   delta
common_ping_main                                    1788    1831     +43
sendping6                                             56      82     +26
sendping4                                             82     108     +26
packed_usage                                       29959   29938     -21
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 95/-21)             Total: 74 bytes

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-08-27 16:01:25 +02:00
Morten Kvistgaard
feac9b607d ftpd: add optional support for authentication
function                                             old     new   delta
cmdio_get_cmd_and_arg                                  -     237    +237
get_passwd                                             -      97     +97
check_password                                         -      82     +82
ftpd_main                                           2297    2178    -119
ask_and_check_password_extended                      206      84    -122
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 0/2 up/down: 416/-241)          Total: 175 bytes

Signed-off-by: Morten Kvistgaard <MK@pch-engineering.dk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-08-05 21:57:18 +02:00
Ken Sharp
a4d564ad7c zcip: fix link-local IP conflict detection
During link-local IP resolution, if a regular ARP request is received
during the ARP probe period, it will incorrectly cause a target IP
conflict.  This then leads to a new IP being picked unnecessarily.

Per RFC 3927, section 2.2.1, we should flag a target IP conflict only if
the source IP is null, the target IP matches our IP, and the source
hw addr does not match our hw addr.

function                                             old     new   delta
zcip_main                                           1354    1322     -32

Signed-off-by: Ken Sharp <ken.sharp@ni.com>
Signed-off-by: Ben Shelton <ben.shelton@ni.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-07-20 14:01:49 +02:00
Jeremy Kerr
b8ffd11e65 udhcp: add PXELINUX path prefix option (code 210) definition
Like d3092c99, this change adds support for the DHCP "path-prefix"
option, as defined in RFC 5071. We use the string identifer
"pxepathprefix".

Adding this option makes string parsing in the hook scripts simpler.

function                                             old     new   delta
dhcp_option_strings                                  255     269     +14
dhcp_optflags                                         72      74      +2

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-07-16 14:21:42 +02:00
Denys Vlasenko
278842dd72 ntpd: add support for -I IFACE
function                                             old     new   delta
packed_usage                                       29908   29947     +39
ntp_init                                             428     460     +32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 71/0)               Total: 71 bytes

Signed-off-by: Nikolaus Froehlich <nikolaus@mathematik.uni-marburg.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-07-15 15:06:54 +02:00
Denys Vlasenko
9d7cbdeee3 ftpd: do not use root_fd if we are not in chroot
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-06-27 13:53:35 +02:00
Denys Vlasenko
27c290f7f2 ftpd: for LIST, open current directory *in the child*
Last change introduced an open fd leak. This is the fix.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-06-27 12:37:00 +02:00
Denys Vlasenko
a6ae999b3b ftpd: escape chroot prior to re-executing ls helper
When we merely chdir to saved "real" root fd,
exec("proc/self/exe") works for static executables but not
for dynamic ones (they can't find their interpreter).

With this patch, we also *chroot* to real root.
As a bonus, this gives us proper usernames, timezone conversion
etc.

function                                             old     new   delta
popen_ls                                             203     259     +56
ftpd_main                                           2362    2366      +4

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-06-27 12:24:39 +02:00
Denys Vlasenko
0b0ccd4570 ftpd: optimize writes of LIST results a bit
function                                             old     new   delta
handle_dir_common                                    201     207      +6

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-06-26 12:07:48 +02:00
Denys Vlasenko
de3cae1348 ftpd: support deprecated XPWD command
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-06-25 16:23:59 +02:00
Bartosz Golaszewski
5d2e409ef8 libbb: use a wrapper around sysconf(_SC_CLK_TCK) to save a few bytes
function                                             old     new   delta
bb_sc_clk_tck                                          -      10     +10
timescmd                                             118     113      -5
print_route                                         1763    1758      -5
mpstat_main                                         1288    1283      -5
iostat_main                                         1947    1942      -5
INET_setroute                                        879     871      -8
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/5 up/down: 10/-28)            Total: -18 bytes
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-06-22 14:01:13 +02:00
Denys Vlasenko
85090c162b udhcpc: make hostname sanitization optional. Closes 3979
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-06-16 00:17:00 +02:00
Denys Vlasenko
e765b5ac34 libbb: rename execable -> executable. No code changes
English speakers complained that it sounded awfully broken.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-05-02 17:15:58 +02:00
Denys Vlasenko
5a21c8550e ntpd: fix wrong delay value in one of the printed messages
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-04-20 13:04:23 +02:00
Denys Vlasenko
d531f93f64 ntpd: truly ignore high delay packet
Before this cahnge, sometimes they were used after the next packet
from another peer was received, because we did updare some peer stats
from high delay packet before dropping it.

function                                             old     new   delta
recv_and_process_peer_pkt                            922     966     +44

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-04-19 19:00:16 +02:00
Denys Vlasenko
faa9e94db6 wget: fix a case where progress bar isn't updated if writes are very slow
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-27 16:50:29 +01:00
Denys Vlasenko
504fe45f35 ntpd: add optional support for /etc/ntp.conf
function                                             old     new   delta
add_peers                                              -      98     +98
packed_usage                                       29470   29511     +41
ntp_init                                             407     428     +21
pw_encrypt                                            14      27     +13
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 3/0 up/down: 173/0)             Total: 173 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-23 18:34:51 +01:00
Denys Vlasenko
0ed5f7aacd use [s]rand(), not [s]random()
rand() is the most standard C library function,
and on uclibc they are the same. I guess
they are the same in most todays' libc...

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-05 18:58:15 +01:00
Denys Vlasenko
ecd8c3affc ip link: add support for "address ETHADDR". Closes 4862
function                                             old     new   delta
do_iplink                                           2175    2289    +114

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-01 17:38:41 +01:00
Denys Vlasenko
e2318bbad7 udhcpc: ignore NAKs from "wrong" servers. Closes 4267
function                                             old     new   delta
udhcpc_main                                         2716    2814     +98

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-27 18:15:50 +01:00
Denys Vlasenko
c472898eaa nc: fix option bit positions. Closes 6926
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-26 13:58:59 +01:00
Denys Vlasenko
a2796223cb wget: fix comment
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-24 17:20:40 +01:00
Denys Vlasenko
53315570bb wget: add commented-out code to use ssl_helper instead of openssl
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-23 23:39:47 +01:00
Denys Vlasenko
d82046f59f networking/ssl_helper: experimental matrixssl-based ssl helper
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-23 23:31:13 +01:00
Denys Vlasenko
8b7e8ae224 wget: add support for https using "openssl s_client" as a helper
www.kernel.org started redirecting http:// to https://
making https support mandatory for any auto build scripts.

function                                             old     new   delta
wget_main                                           2631    2971    +340
parse_url                                            409     471     +62
.rodata                                           115607  115626     +19
P_HTTPS                                                -       6      +6
P_HTTP                                                 -       5      +5
P_FTP                                                  -       4      +4
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 3/0 up/down: 436/0)             Total: 436 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-22 14:12:29 +01:00
Denys Vlasenko
ffc3a93d0d udhcpc: fix BPF filter. Hopefully fixes the root cause of 4598 and 6746
Use a *signed* large positive value in BPF filter to indicate success.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-19 14:17:11 +01:00
Denys Vlasenko
50e4cc29f5 ifplugd: code shrink
function                                             old     new   delta
ifplugd_main                                        1161    1144     -17

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-10 09:51:03 +01:00
Denys Vlasenko
3e78f6f955 htpd: trivial simplification in random interval selection
function                                             old     new   delta
poll_interval                                         57      52      -5

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-09 15:35:04 +01:00
Denys Vlasenko
744ee5db1c udhcpc: in comments, explain the kind of raw socket we create
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-07 17:38:52 +01:00
Denys Vlasenko
e4785ca653 udhcpc: don't use BPF filter, users report problems (bugs 4598, 6746)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-03 18:03:42 +01:00
Kaarle Ritvanen
fe8390e0fe ifupdown: support 'link' address family
Does not configure anything. L2 configuration hook scripts should do
their job on receiving ADDRFAM=link. Configuration will be done only
once, irrespective of L3 protocols used.

Using the 'link' family in the interfaces file conforms to the Debian
implementation:

http://sources.debian.net/src/ifupdown/0.7.47.1/link.defn

function                                             old     new   delta
link_methods                                           -      12     +12
addr_link                                              -      12     +12
link_up_down                                           -       6      +6
static.addr_fams                                      12      16      +4
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 1/0 up/down: 34/0)               Total: 34 bytes

Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-03 15:56:20 +01:00
Denys Vlasenko
d353bfff46 wget: fix use-after-free of ->user. Closes 6836
function                                             old     new   delta
wget_main                                           2207    2223     +16
parse_url                                            339     353     +14

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-03 14:09:42 +01:00
Eugene Rudoy
731f596175 iplink: fix build with kernel versions prior to 2.6.23
Signed-off-by: Eugene Rudoy <gene.devel@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-22 11:49:46 +01:00
Denys Vlasenko
c009d35f00 ntpd: remove now unnecessary check for IP_PKTINFO definition
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-20 03:24:51 +01:00
Bartosz Golaszewski
76ad7481b1 ntpd: fix compilation warnings
GCC complained about since_last_update being set but not used.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-20 03:21:08 +01:00
Denys Vlasenko
604b7b6cc0 fakeidentd: simplify ndelay manipulations
function                                             old     new   delta
new_peer                                              91      79     -12
do_rd                                                197     152     -45

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-10 17:12:54 +01:00
Denys Vlasenko
3deabea893 fixlet for the previous commit #2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-09 20:09:43 +01:00
Denys Vlasenko
abaf9109bd fixlet for the previous commit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-09 20:05:47 +01:00
Denys Vlasenko
3ea93e853e networking: explain isrv_run() API
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-09 19:58:19 +01:00
Ryan Mallon
89deb22f97 fakeidentd: fix use-after-free
function                                             old     new   delta
do_rd                                                199     197      -2

Signed-off-by: Ryan Mallon <rmallon@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-09 19:15:16 +01:00
Denys Vlasenko
f0058b1b1f ping: revert "try SOCK_DGRAM if no root privileges"
It wasn't working, and fixes on top of it would make ping
noticeably larger.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-09 11:53:26 +01:00