[Prev][Next][Index][Thread]

Re: some bugs in netboot



Thanks for the note, Bernard.  I'll take a bit of time today and whack on
netboot to get rid of some of the problems you've pointed out here, and
send out a patch to the list in a while.

Thanks again!  This is extremely helpful.

   -Dave

Lo and behold, Bernard Cassagne once said:
> 
> I have been using netboot for some time now, and I found it immensely useful.
> However, in the process of using it, I have found some bugs, here they are :
> 
> 1/ first, something minuscule : main is declared void instead of int, not
>    really a bug, but gcc complains (and compilations without warning makes
>    the user happy :-)
> 
> 2/ in file main.c, the function build_cmdline() has the declaration
>    char *toks[strlen(input)];
>    this is incorrect since input can be NULL (it will be everytime the command
>    is simply a <progname> (no booting option, no argument to main)
> 
> 3/ in file main.c, in the function main(), the variable input is initialized
>    on entry :
>    char *input = buf;
>    It should be initialized at every iteration in the loop beginning with
>    the label reprompt: since input is moved at the begining of the <progname>
> 
>    I know the bug will show up in very rare events (in the case of plenty of
>    erroneous commands beginning with plenty of white spaces) but it is there.
> 
> 4/ now something more serious.
>    netboot does not aswer ARP requests : it sends ARP requests and relies on
>    the fact that the server will update its arp table with the information
>    provided with the request of the client.
> 
>    This scheme will not work in the following sequence of events :
> 
>    - the user types a command <machine>:/<dir>/<file>
>       if <machine> is ok, but <file> is not, the client will issue an
>       ARP request , and will memorise it knows the ethernet address of the
>       server. Since <file> is erroneous, the command results in an error.
> 
>    - it takes some time for the user to understand why it is wrong 
>       (typo, file not in the right place etc ...)
>       during this time, the arp entry IN THE SERVER obsoletes.
>       [ my server is a linux box and arp entries obsolete in a matter of a
>         few seconds ]
> 
>    - now, the user types the right command and it does not work !
>      Explanation : the client knows the ethernet address of the server and
>      does not issue an ARP request. But the server will issue an ARP
>      request and the client will never answer.
> 
>    - at this moment, netboot is in a completely useless state : right
>      commands are not serviced.
> 
>    The problem shows up only in the case of a wrong command followed by a
>    right command. This is so because after every right command, netboot
>    completely re-initialises itself.
> 
>    I have not corrected the bug because I have not plunged deeply enough in
>    the arcanes of oskit to be able to make netboot answer ARP requests.
>    I have simply devised a simple work-around :
> 
>    void obsoletearpentry(int entry)
>    {
>    int j;
> 
>    for (j = 0; j < 6; j++)
>       arptable[entry].node[j] = 0;
>    }
> 
>    and I call obsoletearpentry(ARP_ROOTSERVER);
>    at every iteration in the loop reprompt: in main()
> 
>    it works for me.
> 
>    Hope this helps,
> 
> -- 
> Amicalement,
> 
> -------------------------------------------------------------------------------
> Bernard Cassagne                 Laboratoire CLIPS - IMAG
> Domaine Universitaire       BP 53         38041 Grenoble CEDEX 9         FRANCE
> tel: 04.76.51.46.14     fax: 04.76.44.66.75     e-mail:Bernard.Cassagne@imag.fr
> 


-- 
work: danderse@cs.utah.edu                     me:  angio@pobox.com
      University of Utah CS Department         http://www.angio.net/
   "If you haul a man up a crack, you will bloody his fingers for a day...
    If you teach a man to climb, you will bloody his fingers for life."


Follow-Ups: References: