diff options
author | Denys Vlasenko | 2018-04-17 12:43:54 +0200 |
---|---|---|
committer | Denys Vlasenko | 2018-04-17 12:43:54 +0200 |
commit | 2aeb201c9751d4ee82978c623310e14b9e831b94 (patch) | |
tree | 3f4d72e70d39889e981de68b56799ee2bf85ce78 /networking/telnet.c | |
parent | 816d8d7a668b541cee99469edb90e4917ea11c3e (diff) | |
download | busybox-2aeb201c9751d4ee82978c623310e14b9e831b94.zip busybox-2aeb201c9751d4ee82978c623310e14b9e831b94.tar.gz |
libbb: new option FEATURE_ETC_SERVICES: if off, /etc/services reads often avoided
In practice, "wget http://host.com/" always uses port 80.
People explicitly set non-standard ports via options or parameters
("telnet 1.2.3.4 567" or "telnet 1.2.3.4 ftp") instead of modifying
/etc/services.
function old new delta
telnet_main 1466 1464 -2
rdate_main 215 198 -17
fakeidentd_main 269 252 -17
parse_url 459 392 -67
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-103) Total: -103 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/telnet.c')
-rw-r--r-- | networking/telnet.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/networking/telnet.c b/networking/telnet.c index 15d6a08..1e6be85 100644 --- a/networking/telnet.c +++ b/networking/telnet.c @@ -643,7 +643,8 @@ int telnet_main(int argc UNUSED_PARAM, char **argv) if (!*argv) bb_show_usage(); host = *argv++; - port = bb_lookup_port(*argv ? *argv++ : "telnet", "tcp", 23); + port = *argv ? bb_lookup_port(*argv++, "tcp", 23) + : bb_lookup_std_port("telnet", "tcp", 23); if (*argv) /* extra params?? */ bb_show_usage(); |