Commit Graph

2123 Commits

Author SHA1 Message Date
Denys Vlasenko
7981d79ef0 udhcpc: small code shrink
function                                             old     new   delta
udhcp_recv_raw_packet                                430     425      -5

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-20 10:34:05 +02:00
Denys Vlasenko
f461385521 typo fix in comment
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-20 08:54:16 +02:00
Denys Vlasenko
1f56e51ca1 udhcpc: add support for DHCP option 212 (RFC 5969)
The patch is from OpenWRT people.

function                                             old     new   delta
xmalloc_optname_optval                               637     874    +237
dhcp_option_strings                                  237     243      +6
dhcp_optflags                                         68      70      +2
len_of_option_as_string                               12      13      +1
dhcp_option_lengths                                   12      13      +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/0 up/down: 247/0)             Total: 247 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 22:40:35 +02:00
Denys Vlasenko
2ea73b513d nc: small code shrink
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 22:31:01 +02:00
Denys Vlasenko
9c28fb8d28 ifupdown: code shrink
function                                             old     new   delta
keywords_up_down                                       -      43     +43
set_environ                                          371     259    -112
ifupdown_main                                       2194    2073    -121
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/2 up/down: 43/-233)          Total: -190 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 02:37:08 +02:00
Peter Korsgaard
dd82443b92 ifupdown: support post-up / pre-down hooks
function                                             old     new   delta
set_environ                                          330     371     +41
ifupdown_main                                       2156    2194     +38
iface_up                                              97     113     +16
iface_down                                            97     113     +16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 111/0)             Total: 111 bytes

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 02:35:54 +02:00
Vladislav Grishenko
6464f15ddb udhcpc: on SIGUSR1, limit renew attempts time to 20 seconds; then do total reconfig
Scenario:

1. udhcpc gets lease for 86400 secs and sleeps for 43200 before renew attempt

2. PC gets physically disconnected and connected to another network

3. some phy control software sends SIGUSR1 to renew the lease, SIGUSR2 isn't
used because newly connected network could be the same as before

4. udhcpc sends unicast renew requests until lease timeout fall to 60 sec.
They are ignored by new network dhcp servers

5. udhcpc sends broadcast rebind requests for 60 seconds, which are NAKed
or ignored too

6. udhcpc deconfigs and starting from discover state, gets new lease for the
new network

So, pt.4+5 it could take up to 86400 secs without correct lease, which is
too long and not acceptable.

Second SIGUSR1 will immediately run into deconfig/discover state, which is
not preferable in case of the same subnet replugged.

This patch makes sure after SIGUSR1 timeout is no more than -A NUM
(usually 20 sec). It means that renew will be requested via broadcast,
and if no replies come back, full deconf/reconf cycle will be initiated
in 20 seconds.

Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-18 01:37:47 +02:00
Leonid Lisovskiy
6c9c0a1dc9 udhcp: IF_UDHCP_VERBOSE() macro - improve code readability
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-18 00:35:47 +02:00
Denys Vlasenko
faf7c62f1d tftp: mode string is case independent
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-06 17:19:09 +02:00
Denys Vlasenko
16714245f9 add INIT_G()'s. No code changes.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-21 01:59:15 +02:00
Denys Vlasenko
585541e8e3 start_stop_daemon: set complementary group ids too. Closes 3253
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-15 18:27:05 +02:00
Denys Vlasenko
dd1061b6a7 wget: URL-decode user:password before base64-encoding it into auth hdr. Closes 3625.
function                                             old     new   delta
percent_decode_in_place                                -     152    +152
parse_url                                            304     317     +13
handle_incoming_and_exit                            2795    2798      +3
httpd_main                                           763     760      -3
decodeString                                         152       -    -152
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 2/1 up/down: 168/-155)           Total: 13 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-11 21:04:02 +02:00
Denys Vlasenko
5126cf9a15 ping: display real IPv6 response address. Hopefully closes 3745.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-11 20:27:28 +02:00
Denys Vlasenko
223b9417b3 inetd: close new udp fd in "udp nowait" case
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-11 16:48:21 +02:00
Baruch Siach
289c47b049 udhcp: remove the declaration of non-existent udhcp_checksum
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-09 11:03:45 +02:00
Baruch Siach
e8f36330d9 networking: consolidate the IP checksum code. -129 bytes.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-07 17:55:40 +02:00
Denys Vlasenko
4abcb8b0d1 tcpudp: simplify help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-07-25 16:35:44 +02:00
Denys Vlasenko
14bd16ac56 more tweak for bionic
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-07-08 08:49:40 +02:00
Dan Fandrich
b5de0c12d6 typo fixes
Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-07-08 05:47:49 +02:00
Bernhard Reutner-Fischer
901a53baec inetd: check if RPC is available
It would be better to have FEATURE_HAVE_RPC be user-selectable and
depend mount.nfs and inetd-rpc on it instead of the current, backward,
way.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-06-15 09:41:00 +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
Daniel Fandrich
6295d273ad Replaced __u32 etc. with standard uint32_t style types
Signed-off-by: Daniel Fandrich <dfandrich@intrinsyc.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-10 05:34:05 +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
66426760be *: remove "Options:" string from help texts
function                                             old     new   delta
packed_usage                                       28706   28623     -83

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-05 03:58:28 +02:00
Denys Vlasenko
5d3aaceb79 udhcpc: allow -O OPT take numeric params
function                                             old     new   delta
udhcpc_main                                         2623    2654     +31

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-04 05:07:16 +02:00
Cristian Ionescu-Idbohrn
662972a77a The [-Wunused-but-set-variable] warnings
networking/ntpd.c:1748:19: warning: variable 'version' set but not used

Signed-off-by: Cristian Ionescu-Idbohrn <cii@axis.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-16 03:53:00 +02:00
Denys Vlasenko
60a9414cad fix "variable 'foo' set but not used" warnings
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-13 20:57:01 +02:00
Denys Vlasenko
12a432715f adduser: safe username passing to passwd/addgroup
passwd: support creating SHA passwords
random code shrink

function                                             old     new   delta
crypt_make_pw_salt                                     -      87     +87
adduser_main                                         883     904     +21
...
crypt_make_salt                                       99      89     -10
chpasswd_main                                        329     312     -17
packed_usage                                       28731   28691     -40
passwd_main                                         1070    1000     -70
cryptpw_main                                         310     224     -86
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 4/12 up/down: 154/-288)        Total: -134 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-13 03:19:01 +02:00
Denys Vlasenko
b1ab283f0b inetd: add FIXMEs
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-12 23:05:27 +02:00
Denys Vlasenko
a348b4557d traceroute: properly reduce poll timeout
This removes the problem where during the time we wait to declare
a target as unresponsive we receive an unrelated ICMP packet.
If there is enough traffic, this can make traceroute hang as
it never declares the target as unresponsive.

function                                             old     new   delta
common_traceroute_main                              4196    4261     +65

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-05 02:31:30 +02:00
Denys Vlasenko
7945808c87 udhcp: fix some default values from "" to NULL
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-03 16:46:47 +02:00
Nigel Hathaway
fb6b173ff7 udhcp: add FEATURE_UDHCP_8021Q option
function                                             old     new   delta
dhcp_option_strings                                  217     237     +20
dhcp_optflags                                         64      68      +4

Signed-off-by: Nigel Hathaway <Nigel.Hathaway@ubiquisys.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-26 02:50:00 +02:00
Nigel Hathaway
c37d4c67e8 dhcpc: export unrecognized options in "optNN=XXXXXXXXX" form
function                                             old     new   delta
udhcp_run_script                                     609     818    +209

Signed-off-by: Nigel Hathaway <Nigel.Hathaway@ubiquisys.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-26 02:38:29 +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
Denys Vlasenko
d506897b4e wget: add a note about bug 3625
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-16 19:31:08 +02:00
Denys Vlasenko
2514302658 Use net/ethernet.h instead of linux/if_ether.h in more cases. Closes 3619
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-16 18:31:53 +02:00
Denys Vlasenko
88d3cfdb75 add forgotten #include
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-11 05:24:58 +02:00
Denys Vlasenko
532e961f7e tftpd: add -l "log to syslog" option. Needed for inetd mode
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-11 05:12:53 +02:00
Denys Vlasenko
24ec952f14 tftp: fix progress bar for large (>32M) files. Closes 3499
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-11 04:29:39 +02:00
Pere Orga
5bc8c005a8 move remaining help text from include/usage.src.h
Signed-off-by: Pere Orga <gotrunks@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-11 03:29:49 +02:00
Denys Vlasenko
d277f55ebd http: document index.cgi usage. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-10 03:08:22 +02:00
Denys Vlasenko
ca18311d0a libbb: make set_nport accept pointer to sockaddr, not to len_and_sockaddr.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-07 17:52:20 +02:00
Denys Vlasenko
8e23fafade ntpd: decrease ntpd -q "no response" timeout to 10 sec
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-07 01:45:20 +02:00
Peter Korsgaard
95755181b8 httpd: don't send error messages with gzip encoding
If CONFIG_FEATURE_HTTPD_GZIP is enabled and request contained
'Accept-Encoding: gzip', then errors were sent with 'Content-Encoding: gzip'
even though they aren't.

Fix it by clearing content_gzip before sending the headers.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-27 23:26:33 +02:00
Vitaly Magerya
700fbc308d wget: --post-data=STR should not encode STR, should send it verbatim
This matches GNU Wget 1.12 behavior.

Signed-off-by: Vitaly Magerya <vmagerya@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-27 22:33:13 +02:00
Vitaly Magerya
7f4b769c42 don't call freeaddinfo(NULL)
Signed-off-by: Vitaly Magerya <vmagerya@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-22 20:14:26 +01:00
Denys Vlasenko
e2e55b0eb5 wget: move help text to .c file
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-21 00:37:05 +01:00
Denys Vlasenko
625f218d43 wget: fix fname_out usage wrt redirects
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-21 00:29:37 +01:00
Denys Vlasenko
9ac5596a51 udhcpc: emit "correct" secs field
In theory, sending secs set to constant zero should be ok too.
But some bleeping servers can actually be configured to answer ONLY
if secs is bigger than a preset value (!!)
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/bootpd.8.html
grep for "reply_threshold_seconds"

function                                             old     new   delta
udhcpc_main                                         2573    2623     +50

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-12 05:37:54 +01:00
Denys Vlasenko
681efe20d3 use user's shell instead of hardwired "/bin/sh" (android needs this)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-08 21:00:36 +01:00