[2289] in Kerberos-V5-bugs

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

telnet/57: -S support for systems without gettosbyname()

daemon@ATHENA.MIT.EDU (John Hawkinson)
Fri Oct 4 04:41:25 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: Fri, 4 Oct 1996 04:40:36 -0400 (EDT)
From: John Hawkinson <jhawk@bbnplanet.com>
To: krb5-bugs@MIT.EDU

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


>Number:         57
>Category:       telnet
>Synopsis:       -S support for systems without gettosbyname()
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    hartmans
>State:          open
>Class:          change-request
>Submitter-Id:   unknown
>Arrival-Date:   Fri Oct e 04:41:01 EDT 1996
>Last-Modified:
>Originator:     John Hawkinson
>Organization:
                 BBN Planet
>Release:        beta-7
>Environment:
System: SunOS all-purpo 4.1.4 4 sun4m
Architecture: sun4

>Description:

Systems that allow setsockopt() for IP_TOS do not have gettosbyname(),
with the singular exception of UNICOS.

Telnet's support for setting the TOS with -S is predicated on support for
gettosbyname().

This is a shame if you'd like to (or have a requirement for) setting the TOS
to a nonstandard value.

The attached patch comes from Greg Christy <gchristy@cisco.com>.  I'm
somewhat reluctant to modify the semantics of it to introduce
incompatibility with other folks who may have applied this patch, but
it appears there may be a conflict in it's assumptions about radix and
those of libtelnet/parsetos.c's parsetos() [this is sscanf("%x")
versus strtol()]. I'm unsure what to do about this apparent conflict,
perhaps Sam and I should discuss it (?).

It occurs to me (belatedly) that one thing to add would be support for
setting the TOS in .telnetrc. Whenever I get around to doing this
(relatively far down on my todo list) I'll send in an attachment to
this PR if it is still open, or do something else creative.

>How-To-Repeat:

[all-purpose-gunk!jhawk] ~> /usr/local/krb5/bin/telnet -Sc0 127.1 127
telnet: Warning: -S ignored, no parsetos() support.
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
[all-purpose-gunk!jhawk] ~> /usr/local/krb5/bin/telnet -S0xc0 127.1 127
telnet: Warning: -S ignored, no parsetos() support.
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused


>Fix:

*** telnet.1	1996/10/04 08:24:13	1.1
--- appl/telnet/telnet/telnet.1	1996/10/04 08:24:25	1.2
***************
*** 82,88 ****
  Set the IP type-of-service (TOS) option for the telnet connection to the
  value
  .I tos,
! which can be a numeric TOS value or, on systems that support it, a
  symbolic TOS name found in the /etc/iptos file.
  .TP
  \fB\-X\fP \fIatype\fP
--- 82,88 ----
  Set the IP type-of-service (TOS) option for the telnet connection to the
  value
  .I tos,
! which can be a numeric TOS value in hex or, on systems that support it, a
  symbolic TOS name found in the /etc/iptos file.
  .TP
  \fB\-X\fP \fIatype\fP
*** main.c	1996/10/04 08:17:50	1.1
--- appl/telnet/telnet/main.c	1996/10/04 08:24:25	1.2
***************
*** 41,46 ****
--- 41,50 ----
  
  #include <sys/types.h>
  
+ #ifdef unix
+ # include <netinet/in.h>
+ #endif
+ 
  #include "ring.h"
  #include "externs.h"
  #include "defines.h"
***************
*** 168,173 ****
--- 172,183 ----
  					prompt, ": Bad TOS argument '",
  					optarg,
  					"; will try to use default TOS");
+ #endif
+ #if defined(IPPROTO_IP) && defined(IP_TOS)
+                       extern int tos;
+ 
+                       sscanf(optarg, "%x", &tos);
+                       fprintf(stderr, "Setting TOS to 0x%x\n", tos);
  #else
  			fprintf(stderr,
  			   "%s: Warning: -S ignored, no parsetos() support.\n",
>Audit-Trail:
>Unformatted:

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