diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-17 12:43:54 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-17 12:43:54 +0200 |
commit | 2aeb201c9751d4ee82978c623310e14b9e831b94 (patch) | |
tree | 3f4d72e70d39889e981de68b56799ee2bf85ce78 /include | |
parent | 816d8d7a668b541cee99469edb90e4917ea11c3e (diff) | |
download | busybox-w32-2aeb201c9751d4ee82978c623310e14b9e831b94.tar.gz busybox-w32-2aeb201c9751d4ee82978c623310e14b9e831b94.tar.bz2 busybox-w32-2aeb201c9751d4ee82978c623310e14b9e831b94.zip |
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 'include')
-rw-r--r-- | include/libbb.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index 646c58bf2..a605c7f03 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -640,6 +640,11 @@ int setsockopt_bindtodevice(int fd, const char *iface) FAST_FUNC; | |||
640 | int bb_getsockname(int sockfd, void *addr, socklen_t addrlen) FAST_FUNC; | 640 | int bb_getsockname(int sockfd, void *addr, socklen_t addrlen) FAST_FUNC; |
641 | /* NB: returns port in host byte order */ | 641 | /* NB: returns port in host byte order */ |
642 | unsigned bb_lookup_port(const char *port, const char *protocol, unsigned default_port) FAST_FUNC; | 642 | unsigned bb_lookup_port(const char *port, const char *protocol, unsigned default_port) FAST_FUNC; |
643 | #if ENABLE_FEATURE_ETC_SERVICES | ||
644 | # define bb_lookup_std_port(portstr, protocol, portnum) bb_lookup_port(portstr, protocol, portnum) | ||
645 | #else | ||
646 | # define bb_lookup_std_port(portstr, protocol, portnum) (portnum) | ||
647 | #endif | ||
643 | typedef struct len_and_sockaddr { | 648 | typedef struct len_and_sockaddr { |
644 | socklen_t len; | 649 | socklen_t len; |
645 | union { | 650 | union { |