aboutsummaryrefslogtreecommitdiff
path: root/networking/nc.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* nc: switch to using poll(2)Ron Yorston2023-03-031-49/+2
| | | | | | | | | | | | Upstream started using poll(2) rather than select(2) in `nc` some time ago, in commit 5b3b468ec (nc: use poll() instead of select()). Now that poll(2) in busybox-w32 has been updated to work with `nc` switch to using the same code as upstream. As a result of this change nothing in busybox-w32 now uses the select(2) implementation. This reduces the size of the binaries by about 3.4KB.
* Merge busybox into mergeRon Yorston2022-01-061-2/+2
|\ | | | | | | | | | | Fix merge conflict in miscutils/less.c. Use exit_SUCCESS() where possible.
| * libbb: code shrink: introduce and use [_]exit_SUCCESS()Denys Vlasenko2022-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta exit_SUCCESS - 7 +7 _exit_SUCCESS - 7 +7 run_pipe 1562 1567 +5 pseudo_exec_argv 399 400 +1 finish 86 87 +1 start_stop_daemon_main 1109 1107 -2 shutdown_on_signal 38 36 -2 runsv_main 1662 1660 -2 redirect 1070 1068 -2 read_line 79 77 -2 pause_and_low_level_reboot 54 52 -2 list_i2c_busses_and_exit 483 481 -2 less_exit 12 10 -2 identify 4123 4121 -2 grep_file 1161 1159 -2 getty_main 1519 1517 -2 fsck_minix_main 2681 2679 -2 free_session 132 130 -2 fdisk_main 4739 4737 -2 clean_up_and_exit 53 51 -2 bsd_select 1566 1564 -2 bb_daemonize_or_rexec 198 196 -2 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 3/17 up/down: 21/-34) Total: -13 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-09-101-1/+1
|\|
| * libbb: make bb_lookup_port() abort on bad port namesDenys Vlasenko2021-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Also, no need to preserve errno function old new delta .rodata 104247 104241 -6 bb_lookup_port 97 83 -14 nc_main 1039 1018 -21 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-41) Total: -41 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | nc: alter conditional compilationRon Yorston2021-01-241-7/+55
| | | | | | | | | | | | | | | | | | | | Change conditional compilation to use PLATFORM_MINGW32 instead of NC_EXTRA. Enabling NC_EXTRA won't work for busybox-w32, but then it didn't before. Also, instead of just reverting upstream commit 5b3b468ec (nc: use poll() instead of select()) include both old and new code, keyed on PLATFORM_MINGW32.
* | Merge branch 'busybox' into mergeRon Yorston2019-08-161-3/+3
|\|
| * libbb: reduce the overhead of single parameter bb_error_msg() callsJames Byrne2019-07-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Remove fake signal-handling codeRon Yorston2018-03-011-0/+4
| | | | | | | | | | | | | | | | | | Microsoft Windows has only limited support for signals. busybox-w32 initially papered over this fact by adding definitions for unsupported signals and signal-handling functions. Remove this fake code and deal with the consequences by excluding anything that fails to compile as a result.
* | Merge branch 'busybox' into mergeRon Yorston2017-11-031-1/+2
|\|
| * whitespace and comment format fixes, no code changesDenys Vlasenko2017-10-051-1/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-09-271-4/+13
|\|
| * netcat: net applet (alias to nc)Denys Vlasenko2017-09-151-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta packed_usage 31807 31856 +49 applet_names 2701 2708 +7 applet_main 1560 1564 +4 applet_install_loc 195 196 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 61/0) Total: 61 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: make vfork fail at compile-timeRon Yorston2017-08-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Nothing in busybox-w32 uses fork. Remove the implementations of fork, vfork and xvfork so that, for example, enabling cpio pass-through causes an error at compile-time, not run-time. MinGW-w64 defines pid_t, so we don't have to. Ensure code containing xvfork in netcat is disabled when NC_EXTRA is disabled. Otherwise removing the implementation of vfork costs 64 bytes.
* | Merge branch 'busybox' into mergeRon Yorston2017-07-241-11/+11
|\|
| * config: deindent all help textsDenys Vlasenko2017-07-211-10/+10
| | | | | | | | | | | | Those two spaces after tab have no effect, and always a nuisance when editing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Update menuconfig items with approximate applet sizesDenys Vlasenko2017-07-181-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Revert "nc: use poll() instead of select()"Ron Yorston2017-05-291-16/+17
|/ | | | This reverts commit 5b3b468ec0c6e6dfe772722dbd6b2c57cef817b5.
* nc: use poll() instead of select()Denys Vlasenko2017-02-161-17/+16
| | | | | | | function old new delta nc_main 943 866 -77 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Convert all networking/* applets to "new style" applet definitionsDenys Vlasenko2016-11-231-4/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: hopefully all setup_common_bufsiz() are in placeDenys Vlasenko2016-04-211-1/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: make bb_common_bufsiz1 1 kbyte, add capability to use bss tail for itDenys Vlasenko2016-04-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The config item is FEATURE_USE_BSS_TAIL. When it is off (default): function old new delta read_config 210 228 +18 doCommands 2279 2294 +15 ipneigh_list_or_flush 763 772 +9 ipaddr_list_or_flush 1256 1261 +5 display_process_list 1301 1306 +5 conspy_main 1378 1383 +5 do_lzo_compress 352 355 +3 do_lzo_decompress 565 567 +2 push 46 44 -2 inetd_main 2136 2134 -2 uevent_main 421 418 -3 addLines 97 92 -5 bb_common_bufsiz1 8193 1024 -7169 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 8/5 up/down: 62/-7181) Total: -7119 bytes text data bss dec hex filename 829850 4086 9080 843016 cdd08 busybox_old 829901 4086 1904 835891 cc133 busybox_unstripped FEATURE_USE_BSS_TAIL=y: read_config 210 228 +18 doCommands 2279 2294 +15 ipneigh_list_or_flush 763 772 +9 ipaddr_list_or_flush 1256 1261 +5 display_process_list 1301 1306 +5 conspy_main 1378 1383 +5 do_lzo_compress 352 355 +3 do_lzo_decompress 565 567 +2 inetd_main 2136 2134 -2 bb_common_bufsiz1 8193 - -8193 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 8/1 up/down: 62/-8195) Total: -8133 bytes text data bss dec hex filename 829850 4086 9080 843016 cdd08 busybox_old 829911 4086 880 834877 cbd3d busybox_unstripped FIXME: setup_common_bufsiz() calls are missing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nc: use symbolic SHUT_WR instead of literal 1Denys Vlasenko2013-07-281-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nc: fix build failure ("subscripted value is neither array nor pointer")Denys Vlasenko2013-03-171-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Fix config help textDenys Vlasenko2013-02-281-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nc: don't redirect stderr to network in -e PROG modeDenys Vlasenko2013-02-281-9/+9
| | | | | | This in incompatible with nc-1.10, but makes a lot of sense. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace fixes. no code changesDenys Vlasenko2013-01-141-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: remove "Options:" string from help textsDenys Vlasenko2011-06-051-1/+1
| | | | | | | function old new delta packed_usage 28706 28623 -83 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: make GNU licensing statement forms more regularDenys Vlasenko2010-08-161-4/+4
| | | | | | | This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tweak defconfigDenys Vlasenko2010-07-181-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: introduce and use xfork() and xvfork()Pascal Bellard2010-07-041-4/+2
| | | | | | | | | | | | | | | | function old new delta launch_helper 170 169 -1 setup_heredoc 312 302 -10 handle_dir_common 367 354 -13 expand_vars_to_list 2456 2443 -13 open_transformer 89 74 -15 data_extract_to_command 439 423 -16 do_ipaddr 1406 1389 -17 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/7 up/down: 0/-85) Total: -85 bytes Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nc: introduce CONFIG_NC_110_COMPAT option.Denys Vlasenko2010-06-271-5/+84
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nc: fix nc -ll; report vfork errors; make select loop fasterTomoya Adachi2009-08-031-20/+23
| | | | | | | | function old new delta nc_main 933 946 +13 Signed-off-by: Tomoya Adachi <adachi@il.is.s.u-tokyo.ac.jp> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nc, hush: cosmetic cleanups, no code changesDenys Vlasenko2009-06-011-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* add FEATURE_UNIX_LOCAL. By Ingo van Lil (inguin AT gmx.de)Denis Vlasenko2009-04-251-20/+18
|
* nc: free lsa in server mode, we might be up for a long timeDenis Vlasenko2009-04-211-2/+2
|
* *: mass renaming of USE_XXXX to IF_XXXXDenis Vlasenko2009-04-211-13/+13
| | | | | | and SKIP_XXXX to IF_NOT_XXXX - the second one was especially badly named. It was not skipping anything!
* *: a bit of code shrinkDenis Vlasenko2008-11-091-1/+2
| | | | | | | | | | | | | | function old new delta stop_handler 41 38 -3 sulogin_main 508 504 -4 got_cont 4 - -4 cont_handler 11 - -11 startservice 309 297 -12 processorstart 423 409 -14 tcpudpsvd_main 1861 1843 -18 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 0/5 up/down: 0/-66) Total: -66 bytes
* *: rename ATTRIBUTE_XXX to just XXX.Denis Vlasenko2008-07-051-1/+1
|
* sendmail: fix wrong vfork usage here tooDenis Vlasenko2008-07-011-6/+3
| | | | | | | | | | | | *: shorten error texts function old new delta launch_helper - 151 +151 vfork_or_die 20 - -20 sendgetmail_main 1946 1848 -98 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/1 up/down: 151/-118) Total: 33 bytes
* - use EXIT_{SUCCESS,FAILURE}. No object-code changesBernhard Reutner-Fischer2008-05-191-1/+1
|
* *: fix fallout from -Wunused-parameterDenis Vlasenko2008-03-171-1/+1
| | | | | | | | | | | | | | | | | | function old new delta bbunpack 358 366 +8 passwd_main 1070 1072 +2 handle_incoming_and_exit 2651 2653 +2 getpty 88 86 -2 script_main 975 972 -3 inetd_main 2036 2033 -3 dname_enc 377 373 -4 make_new_session 474 462 -12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/5 up/down: 12/-24) Total: -12 bytes text data bss dec hex filename 797429 658 7428 805515 c4a8b busybox_old 797417 658 7428 805503 c4a7f busybox_unstripped
* mount: recognize "dirsync" (closes bug 835)Denis Vlasenko2008-02-181-7/+10
| | | | | | mount: sanitize environ if called by non-root *: adjust for slightly different sanitize routine
* - be C99 friendly. Anonymous unions are a GNU extension. This change isBernhard Reutner-Fischer2008-01-291-3/+3
| | | | | size-neutral WRT -std=gnu99 and fixes several compilation errors for strict C99 mode.
* add -fvisibility=hidden to CC flags, mark XXX_main functionsDenis Vlasenko2007-10-111-1/+1
| | | | | EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
* introduce and use close_on_exec_on(fd). -50 bytes.Denis Vlasenko2007-09-301-1/+1
|
* Audit bb_common_bufsiz usage, add script which looks for misuse.Denis Vlasenko2007-06-041-5/+3
| | | | | | tr: stop using globals needlessly. code: -103 bytes
* usage.c: remove reference to busybox.hDenis Vlasenko2007-05-261-1/+1
| | | | | *: s/include "busybox.h"/include "libbb.h"
* nc: port nc 1.10 to busyboxDenis Vlasenko2007-04-051-0/+5
|
* tcpsvd: new appletDenis Vlasenko2007-04-011-1/+1
| | | | | | | | | | It's a GPL-ed 'clone' of Dan Bernstein's tcpserver. Author: Gerrit Pape <pape@smarden.org> http://smarden.sunsite.dk/ipsvd/ size tcpsvd.o text data bss dec hex filename 2571 4 16 2591 a1f tcpsvd.o