From: Sam Hartman Date: Mon, 11 Nov 1996 02:13:36 +0000 (+0000) Subject: Commit jhawk's patch to print IP status. X-Git-Tag: krb5-1.0-freeze1~64 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fa2fdf23fe632d0b83ffc42a68c9b1d51b832350;p=krb5.git Commit jhawk's patch to print IP status. [113] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9365 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/telnet/telnet/ChangeLog b/src/appl/telnet/telnet/ChangeLog index 96a6246dc..2a1a0c6dd 100644 --- a/src/appl/telnet/telnet/ChangeLog +++ b/src/appl/telnet/telnet/ChangeLog @@ -2,6 +2,7 @@ Sun Nov 10 17:34:40 1996 Sam Hartman * commands.c (tn): Reverse resolve address to deal with dialup pools [krb5-libs/170] + (tn): Store IP and print in status; patch from jhawk. [113] Fri Nov 1 00:49:21 1996 Sam Hartman diff --git a/src/appl/telnet/telnet/commands.c b/src/appl/telnet/telnet/commands.c index b187f3d35..cfd975e2f 100644 --- a/src/appl/telnet/telnet/commands.c +++ b/src/appl/telnet/telnet/commands.c @@ -96,6 +96,7 @@ int tos = -1; char *hostname; static char _hostname[MAXDNAME]; +struct in_addr hostaddr; extern char *getenv(); @@ -2278,7 +2279,7 @@ status(argc, argv) char *argv[]; { if (connected) { - printf("Connected to %s.\r\n", hostname); + printf("Connected to %s (%s).\r\n", hostname, inet_ntoa(hostaddr)); if ((argc < 2) || strcmp(argv[1], "notmuch")) { int mode = getconnmode(); @@ -2362,7 +2363,6 @@ tn(argc, argv) struct sockaddr_in sin; struct servent *sp = 0; unsigned long temp; - extern char *inet_ntoa(); #if defined(IP_OPTIONS) && defined(IPPROTO_IP) char *srp = 0; unsigned long sourceroute(), srlen; @@ -2470,6 +2470,7 @@ tn(argc, argv) #if defined(IP_OPTIONS) && defined(IPPROTO_IP) } #endif + hostaddr.s_addr = sin.sin_addr.s_addr; if (portp) { if (*portp == '-') { portp++; @@ -2546,6 +2547,8 @@ tn(argc, argv) host->h_addr_list++; memcpy((caddr_t)&sin.sin_addr, host->h_addr_list[0], host->h_length); + memcpy((caddr_t)&hostaddr, + host->h_addr_list[0], host->h_length); (void) NetClose(net); continue; }