Modify bb_lookup_port to allow the protocol to be specified, allowing

/etc/services support for inetd, netcat and tftp.
This commit is contained in:
Glenn L McGrath
2004-01-17 05:03:31 +00:00
parent b03be7f567
commit 036dbaa082
8 changed files with 22 additions and 31 deletions

View File

@ -599,7 +599,7 @@ extern int telnet_main(int argc, char** argv)
bb_show_usage();
bb_lookup_host(&s_in, argv[1]);
s_in.sin_port = bb_lookup_port((argc == 3) ? argv[2] : "telnet", 23);
s_in.sin_port = bb_lookup_port((argc == 3) ? argv[2] : "telnet", "tcp", 23);
G.netfd = xconnect(&s_in);