waiting for ``speed''

Gert Doering (gert@greenie.muc.de)
Sat, 27 Jan 1996 00:45:09 +0100


Hi,

Michael Talbot-Wilson wrote:
> > > end, "CONNECT".  In 0.98 with this modem it often fails to find "CONNECT"
> > > and times out, so I disabled everything but the "CONNECT" message. 
> > 
> > Does it fail to find "CONNECT" or fail to find "speed"? You're somewhat
> > unprecise here. CONNECT should always be seen, "speed" never.
> 
> "CONNECT".  I have (I think!) now increased the buffer size (see below). 
> Might make a difference :-/. 

Nah. This is nonsense. Your log file is definitely waiting for "speed",
which is not what should be there.

> > > (In the example below I typed in "speed" to get a login.  It is
> > > FreeBSD 2.1.  DEFAULT_MODEMTYPE = "data".)
> > 
> > Weird. Could you send me a log file with "mgetty -x9"? This will show me
> > the actual configuration as well.
> 
> > Answering and CONNECT just fine.
> > 
> > > 01/26 04:49:04 yd9  send: 
> > > 01/26 04:49:04 yd9  waiting for ``speed''
> > 
> > This is nonsense. Someone completely misconfigured your mgetty.
> 
> Who, ME??  Never!!... er... well...  I'm sending you diffs showing the
> changes I made to the source (from hpsystem2.informatik.tu-muenchen.de) 
> and config, and the log of an episode at -x9.  Hope you have the patience 
> to look at this.  Thanks.

You made changes to the *SOURCE*? Feel shot.

> +CFLAGS=-O2 -Wall -pipe -DAUTO_PPP -DBSDSTATFS

What kind of system is this? BSDSTATFS should be detected automagically.

> diff -ur mgetty-0.99/conf_mg.c mg-0.99/conf_mg.c
> --- mgetty-0.99/conf_mg.c	Tue Nov 28 04:30:13 1995
> +++ mg-0.99/conf_mg.c	Fri Jan 26 20:57:09 1996
> @@ -45,10 +45,10 @@
>  /* default way to answer the phone...
>   */
>  static char * def_answer_chat_seq[] =
> -			    { "", "ATA", "CONNECT", "\\c", "\n", NULL };
> +			    { "", "ATA", "CONNECT", "\\c" };

Don't touch this! If you need to change it, change it in the config file,
that's what it's for.

Anyway, here you have your problem. You have omitted the trailing "NULL",
which is there to show mgetty where the chat sequence ends. Without that,
it will just run ahead and use the next string it finds, which, by chance,
is "speed" to wait for.

>  /* this is the default configuration...
> diff -ur mgetty-0.99/do_chat.c mg-0.99/do_chat.c
> --- mgetty-0.99/do_chat.c	Sat Nov 25 06:57:41 1995
> +++ mg-0.99/do_chat.c	Fri Jan 26 20:57:10 1996
> @@ -85,7 +85,7 @@
>  	        chat_action_t actions[], action_t * action,
>                  int chat_timeout_time, boolean timeout_first )
>  {
> -#define BUFFERSIZE 500
> +#define BUFFERSIZE 2000

Ah, nonsense. The buffer is used as a "sliding window", that means, if
your "looking for ..." string isn't longer than about 80% of the
buffersize, the size doesn't matter.

> -	if ( ++bytes < 500 ) lputc( L_NOISE, buffer[0] );
> +	if ( ++bytes < 2000 ) lputc( L_NOISE, buffer[0] );

This is completely unrelated. If you hit this, you'll see a message in the
log file to this extent.

> diff -ur mgetty-0.99/login.cfg.in mg-0.99/login.cfg.in
> --- mgetty-0.99/login.cfg.in	Mon Oct 23 02:19:12 1995
> +++ mg-0.99/login.cfg.in	Fri Jan 26 21:02:46 1996
> @@ -49,7 +49,7 @@
>  #  mgetty has to be compiled with "-DAUTO_PPP" for this to work.
>  #  Warning: Case is significant, AUTOPPP or autoppp won't work!
>  #
> -#/AutoPPP/ -	ppp	/usr/sbin/pppd auth -chap +pap login kdebug 7 debug
> +/AutoPPP/ -	ppp	/usr/sbin/pppd auth -chap +pap login kdebug 7 debug

Now *this* is neccesary :)

[..]
> ---------------------------------------------------------------------
> Log file: /tmp/log_mg.ttyd9
> -----------------
> [Hung up waiting for "speed".  That word was then typed in at the
> remote terminal to get a login.]
[..]
> 01/26 12:17:01 yd9    CND: ATA[0d][0a]CONNECT ** found **
> 01/26 12:17:15 yd9  send: 
> 01/26 12:17:15 yd9  waiting for ``speed''

It is waiting for the *literal* string "speed" here.

Ah. See above. Your fiddling with "conf_mg.c" caused this (most likely).
You're lucky, it could have been a "core dump" as well.

> 01/26 12:18:29 yd9   match: user='mike', key='/AutoPPP/'

Better :)


So, what do we learn from it: if you feel like changing source code,
and don't understand what the code does, then *DO NOT CHANGE A SINGLE
CHARACTER*. *NEVER EVER*. Or, if you do, and it stops working, revert
your changes, and see whether it works without them.

Configuration files, and policy.h files, are made to *avoid* the need of
having to change source files to set init strings etc.


Sorry to be so harsh, but this cost me about half an hour. Half an hour I
could have spent working for a living, or for improving mgetty. The only
way I (and the mgetty community) profit from this is that I have "seen
this error before" now (though I doubt I'll see it again).

gert
-- 
                                                            //www.muc.de/~gert
Gert Doering - Munich, Germany                             gert@greenie.muc.de
fax: +49-89-3545980 <---new!!!              gert.doering@physik.tu-muenchen.de