aboutsummaryrefslogtreecommitdiff
path: root/networking
AgeCommit message (Collapse)Author
2020-06-09dhcpc: code shrink in good_hostnameMartin Lewis
Incorporated valid_domain_label into good_hostname to simplify the implementation. function old new delta static.xmalloc_optname_optval 973 958 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-15) Total: -15 bytes text data bss dec hex filename 993144 16915 1872 1011931 f70db busybox_old 993129 16915 1872 1011916 f70cc busybox_unstripped Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-05-20wget: implement TLS verification with ENABLE_FEATURE_WGET_OPENSSLDimitri John Ledkov
When ENABLE_FEATURE_WGET_OPENSSL is enabled, correctly implement TLS verification by default. And only ignore verification errors, if --no-check-certificate was passed. Also note, that previously OPENSSL implementation did not implement TLS verification, nor printed any warning messages that verification was not performed. Bug-Ubuntu: https://bugs.launchpad.net/bugs/1879533 CVE-2018-1000500 Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-04-30httpd: permit non-default home directory with NOMMU enabledRon Yorston
When BusyBox is compiled with NOMMU enabled running httpd with the '-h' option fails even if the specified directory exists: $ ls -d www www $ busybox httpd -fvvvp 8080 -h www ... ... try to access http://localhost:8080/www ... httpd: can't change directory to 'www': No such file or directory The parent process executes xchdir("www"). When a connection is accepted it's handled by re-executing httpd in inetd mode. The child process inherits the current directory "www" and tries to change directory again to "www", which fails. Omit the call to xchdir() when httpd is re-executed. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-02-13tftp: on download, open local file only when first bit of data arrivedDenys Vlasenko
No reason to potentially clobber existing file before absolutely necessary. function old new delta tftp_protocol 1947 2020 +73 tftp_main 393 376 -17 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 73/-17) Total: 56 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-02-13tftp: fix thinko in code shrinkDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-02-13tftp: code shrinkDenys Vlasenko
function old new delta tftp_protocol 1949 1947 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-02-13tftpd: show requested file name in open error messageDenys Vlasenko
function old new delta tftp_protocol 1902 1949 +47 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-01-14udhcpd: mangle hostnames starting with dash ("-option")Denys Vlasenko
function old new delta add_lease 316 328 +12 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-12-03whois: limit total length of response to 32+2 kbDenys Vlasenko
function old new delta query 517 554 +37 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-30ntpd: decrease MIN_FREQHOLD by 2, increase "penalty" for largish offset x2Denys Vlasenko
> 2018-07-25: > ntpd: increase MIN_FREQHOLD by 3 > This means we'll start correcting frequency ~5 minutes after start, > not ~3.5 ones. > With previous settings I still often see largish ~0.7s initial offsets > only about 1/2 corrected before frequency correction kicks in, > resulting in ~200ppm "correction" which is then slowly undone. Review of real-world results of the above shows that with small initial offsets, freq correction can be allowed to kick in sooner, whereas with large (~0.8s) offsets, we still start freq correction a bit too soon. Let's rebalance this a bit. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-27nslookup: implement support for SRV recordsJo-Philipp Wich
Add support for querying and parsing SRV DNS records. function old new delta send_queries 1711 1865 +154 qtypes 72 80 +8 Signed-off-by: Jo-Philipp Wich <jo@mein.io> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-27nslookup: handle replies without RRsJo-Philipp Wich
Under some circumstances, a DNS reply might contain no resource records, e.g. when a valid domain is queried that does not have records of the requested type. Example with nslookup from BIND dnsutils: $ nslookup -q=SRV example.org Server: 10.11.12.13 Address: 10.11.12.13#53 Non-authoritative answer: *** Can't find example.org: No answer Currently the busybox nslookup applet simply prints nothing after the "Non-authoritative answer:" line in the same situation. This change modifies nslookup to either print "Parse error" or "No answer" diagnostics, depending on the parse_reply() return value. function old new delta send_queries 1676 1711 +35 Signed-off-by: Jo-Philipp Wich <jo@mein.io> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-25ntpd: abs(tmx.offset) was truncating a "long" typed valueDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-25tc: array address is never NULLDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-25traceroute: fix gcc-ismDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-25suppress a few "unused function" warningsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-25netstat: suppress a warning (conversion from 'int' to 'smallint' changes value)Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-18telnet: add disabled code to emit EC and IPDenys Vlasenko
> I'm trying to connect to a Korenix 3005 switch through telnet > for management purposes, and all is well except for the backspace character > - seems like my switch doesn't handle it too well and instead of erasing > the last character all it does is print some garbage to the screen. > I've had the same issue before while using putty, but saw a solution that > suggests to enable "Telnet special commands" in the options menu, and it > worked. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-15brctl: code shrinkDenys Vlasenko
function old new delta show_bridge 323 317 -6 brctl_main 2171 2164 -7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-13) Total: -13 bytes text data bss dec hex filename 1002083 551 5612 1008246 f6276 busybox_old 1002065 551 5612 1008228 f6264 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-12brctl: tweak help text, fix commentsDenys Vlasenko
function old new delta packed_usage 33255 33236 -19 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-12brctl: fold show_bridge_ports_ into its callerDenys Vlasenko
function old new delta brctl_main 2235 2171 -64 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-12brctl: code shrinkDenys Vlasenko
packed_usage 33253 33255 +2 write_uint 96 90 -6 show_bridge_timer 93 69 -24 brctl_main 2338 2235 -103 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/3 up/down: 2/-133) Total: -131 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-11brctl: add support for showstp commandMartin Lewis
function old new delta brctl_main 974 2339 +1365 show_bridge_timer - 93 +93 static.state_names - 48 +48 printf_xstrtou - 26 +26 packed_usage 33243 33253 +10 show_bridge 333 323 -10 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 2/1 up/down: 1542/-10) Total: 1532 bytes text data bss dec hex filename 999868 551 5612 1006031 f59cf busybox_old 1002309 551 5612 1008472 f6358 busybox_unstripped Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-08udhcpc: fix segmentation fault on empty bin optMichal Kazior
The following caused udhcpc to segfault: busybox udhcpc -i lo -s /dev/null -x 0x3d: function old new delta udhcp_str2optset 629 641 +12 Signed-off-by: Michal Kazior <michal@plume.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-08brctl: add support for showmacs commandMartin Lewis
function old new delta brctl_main 680 974 +294 packed_usage 33167 33187 +20 compare_fdbs - 19 +19 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/0 up/down: 333/0) Total: 333 bytes Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-10-08route: fix output of "route -n -A inet6"Tomas Paukrt
The output of the command "route -n -A inet6" may be corrupted due to partially initialized structure snaddr6 in the function INET6_displayroutes. Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-09-25telnet: fix uninitialized variable bugDenys Vlasenko
function old new delta telnet_main 1236 1238 +2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-09-24udhcpc6: add ELAPSED_TIME option to outgoing packetsDenys Vlasenko
function old new delta init_d6_packet 53 121 +68 udhcpc_main 2577 2582 +5 udhcpc6_main 2593 2597 +4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 77/0) Total: 77 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-09-12wget: increase redirections limitDavid Demelier
Some hosting services like sourceforge perform a lot of relocations before actually serving the file. Example of current limitation: busybox wget http://sourceforge.net/projects/fluxbox/files/fluxbox/1.3.7/fluxbox-1.3.7.tar.xz Connecting to sourceforge.net (216.105.38.13:80) Connecting to sourceforge.net (216.105.38.13:443) Connecting to sourceforge.net (216.105.38.13:443) Connecting to sourceforge.net (216.105.38.13:443) Connecting to downloads.sourceforge.net (216.105.38.13:443) wget: too many redirections Signed-off-by: David Demelier <markand@malikania.fr> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-08-24udhcpc6: support stateless DHCPv6Eivind Versvik
-l will send Information-Request to request configuration parameters function old new delta packed_usage 33114 33180 +66 send_d6_info_request - 62 +62 udhcpc6_main 2534 2593 +59 udhcpc6_longopts 199 211 +12 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/0 up/down: 199/0) Total: 199 bytes Signed-off-by: Eivind Versvik <versvikeivind@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-08-09udhcpc6: s/iphdr/ip6_hdr/Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-07-02ntpd: add comment about mode6, no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-07-02ntpd: commonalize message stringsDenys Vlasenko
function old new delta recv_and_process_peer_pkt 961 973 +12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 12/0) Total: 12 bytes text data bss dec hex filename 953108 481 7288 960877 ea96d busybox_old 953086 481 7288 960855 ea957 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-07-02libbb: reduce the overhead of single parameter bb_error_msg() callsJames Byrne
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 <james.byrne@origamienergy.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-07-02ntpd: abort if argvs are (unexpectedly) givenDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-06-13udhcpc: fix comment, no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-06-11udhcpc6: fix aliasing warningDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-06-11dhcpc.c: Added support for relay server parameter.Martin Lewis
Resolved a TODO by adding support for gateway_nip parameter. function old new delta udhcp_run_script 792 835 +43 Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-06-09tftp: allow -lc and -cl optionsDenys Vlasenko
function old new delta tftp_main 394 396 +2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-06-09tftpd: revert erroneous changeDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-06-09tftp: optional tftp-hpa compatDenys Vlasenko
function old new delta tftp_main 276 394 +118 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-06-08bc: placate compiler warningsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-06-08brctl: placate compiler warningsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-06-07httpd: .js is "application/javascript", not "application/x-javascript"Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-06-07httpd: add js to built in MIME types listDenys Vlasenko
Firefox needs this to execute .js Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-06-07httpd: add svg to built in MIME types listVicente Jimenez Aguilar
Signed-off-by: Vicente Jimenez Aguilar <googuy@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-06-03libbb: move netlink socket binding to the utility functionDenys Vlasenko
function old new delta create_and_bind_to_netlink - 134 +134 ifplugd_main 1117 1052 -65 uevent_main 399 306 -93 mdev_main 314 215 -99 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/3 up/down: 134/-257) Total: -123 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-05-31dhcp: downgrade "got raw socket fd" message to log3, make log2 default maxDenys Vlasenko
log3 messages are very much redundant function old new delta change_listen_mode 322 302 -20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-05-31dhcp: get rid of static data signal_pipeDenys Vlasenko
function old new delta udhcp_sp_setup 65 110 +45 udhcp_sp_fd_set 60 59 -1 udhcpd_main 1442 1437 -5 udhcpc_main 2684 2679 -5 signal_pipe 8 - -8 packed_usage 33292 33284 -8 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/4 up/down: 45/-27) Total: 18 bytes text data bss dec hex filename 952746 481 7296 960523 ea80b busybox_old 952768 481 7288 960537 ea819 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-05-30udhcp: rename server_config to server_dataDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>