[2353] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

telnet/113: telnet should provide the IP address connected to

daemon@ATHENA.MIT.EDU (John Hawkinson)
Tue Oct 15 20:21:22 1996

Resent-From: gnats@rt-11.MIT.EDU (GNATS Management)
Resent-To: hartmans@MIT.EDU
Resent-Reply-To: krb5-bugs@MIT.EDU, John Hawkinson <jhawk@bbnplanet.com>
Date: Tue, 15 Oct 1996 20:20:23 -0400 (EDT)
From: John Hawkinson <jhawk@bbnplanet.com>
To: krb5-bugs@MIT.EDU

	Note: There was a bad value `medium' for the field `>Severity:'.
	It was set to the default value of `serious'.


>Number:         113
>Category:       telnet
>Synopsis:       telnet should provide the IP address connected to
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    hartmans
>State:          open
>Class:          change-request
>Submitter-Id:   unknown
>Arrival-Date:   Tue Oct e 20:21:01 EDT 1996
>Last-Modified:
>Originator:
>Organization:
		 BBN Planet
>Release:        beta-7
>Environment:
System: SunOS all-purpo 4.1.4 4 sun4m
Architecture: sun4

>Description:

When telnetting to multiple-interfaced hosts (i.e. round robin
A records), it's sometimes useful to know which one you've
landed on.

The current interface can give you this information at connect
time, but generally you're more interested in getting it
much later.

This patch adds support to telnet for keeping track of
the current IP address outside of the scope of the tn() function
(just like it currently does with "hostname"), and displaying
it respone to the "status" command.

>How-To-Repeat:

umm, scratch your head wondering what IP address you've managed to
connect to and decide that running "netstat" is too much trouble or
not deterministic enough.

>Fix:

*** commands.c	1996/10/06 23:21:52	1.2
--- commands.c	1996/10/16 00:01:59	1.3
***************
*** 96,101 ****
--- 96,102 ----
  
  char	*hostname;
  static char _hostname[MAXDNAME];
+ struct in_addr hostaddr;
  
  extern char *getenv();
  
***************
*** 103,108 ****
--- 104,111 ----
  extern char **genget();
  extern int Ambiguous();
  
+ extern char *inet_ntoa();
+ 
  static call();
  
  typedef struct {
***************
*** 2156,2162 ****
      char *argv[];
  {
      if (connected) {
! 	printf("Connected to %s.\r\n", hostname);
  	if ((argc < 2) || strcmp(argv[1], "notmuch")) {
  	    int mode = getconnmode();
  
--- 2159,2165 ----
      char *argv[];
  {
      if (connected) {
! 	printf("Connected to %s (%s).\r\n", hostname, inet_ntoa(hostaddr));
  	if ((argc < 2) || strcmp(argv[1], "notmuch")) {
  	    int mode = getconnmode();
  
***************
*** 2240,2246 ****
      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;
--- 2243,2248 ----
***************
*** 2348,2353 ****
--- 2350,2356 ----
  #if	defined(IP_OPTIONS) && defined(IPPROTO_IP)
      }
  #endif
+     hostaddr.s_addr = sin.sin_addr.s_addr;
      if (portp) {
  	if (*portp == '-') {
  	    portp++;
>Audit-Trail:
>Unformatted:

home help back first fref pref prev next nref lref last post