]>
Commit | Line | Data |
---|---|---|
b52f6eb2 DW |
1 | diff -u telnet/commands.c telnet.new/commands.c |
2 | --- telnet/commands.c Sat Sep 1 12:55:18 2001 | |
3 | +++ telnet.new/commands.c Sat Sep 1 12:54:36 2001 | |
4 | @@ -2354,6 +2354,7 @@ | |
5 | hints.ai_flags = AI_CANONNAME; | |
6 | if (portp == NULL) { | |
7 | portp = "telnet"; | |
8 | + telnetport = 1; | |
9 | } else if (*portp == '-') { | |
10 | portp++; | |
11 | telnetport = 1; | |
12 | @@ -2397,7 +2398,6 @@ | |
13 | if (error) { | |
14 | warn("%s: %s", aliasp, gai_strerror(error)); | |
15 | close(net); | |
16 | - freeaddrinfo(ares); | |
17 | continue; | |
18 | } | |
19 | if (bind(net, ares->ai_addr, ares->ai_addrlen) < 0) { | |
20 | @@ -2414,7 +2414,7 @@ | |
21 | perror("setsockopt (IP_OPTIONS)"); | |
22 | #endif | |
23 | #if defined(IPPROTO_IP) && defined(IP_TOS) | |
24 | - { | |
25 | + if (res->ai_family == AF_INET) { | |
26 | # if defined(HAS_GETTOS) | |
27 | struct tosent *tp; | |
28 | if (tos < 0 && (tp = gettosbyname("telnet", "tcp"))) | |
29 | @@ -2438,7 +2438,7 @@ | |
30 | char hbuf[NI_MAXHOST]; | |
31 | ||
32 | if (getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, sizeof(hbuf), | |
33 | - NULL, 0, NI_NUMERICHOST) != 0) { | |
34 | + NULL, 0, niflags) != 0) { | |
35 | strcpy(hbuf, "(invalid)"); | |
36 | } | |
37 | fprintf(stderr, "telnet: connect to address %s: %s\n", hbuf, |