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

some bugs in netboot



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


Follow-Ups: