[Spread-cvs] cvs commit: spread/daemon configuration.c Readme.txt

jonathan at spread.org jonathan at spread.org
Mon Sep 27 01:15:49 EDT 2004


jonathan    04/09/27 01:15:48

  Modified:    daemon   configuration.c Readme.txt
  Log:
  Add configuration check to quit if both a localhost segment and a
  non-localhost segment exist. This prevents an invalid configuration from
  being entered accidentally (and hopefully should prevent some questions
  on the spread-users list).
  
  Revision  Changes    Path
  1.10      +22 -0     spread/daemon/configuration.c
  
  Index: configuration.c
  ===================================================================
  RCS file: /storage/cvsroot/spread/daemon/configuration.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- configuration.c	23 Sep 2004 23:15:18 -0000	1.9
  +++ configuration.c	27 Sep 2004 05:15:48 -0000	1.10
  @@ -244,6 +244,28 @@
   
           fclose(yyin);
   
  +        /* Test for localhost segemnt defined with other non-localhost segments.
  +         * That is an invalid configuration 
  +         */
  +        if ( Config.num_segments > 1 ) {
  +            int found_localhost = 0;
  +            int found_nonlocal = 0;
  +            for ( i=0; i < Config.num_segments; i++) {
  +                if ( ((Config.segments[i].bcast_address & 0xff000000) >> 24) == 127 ) {
  +                    found_localhost = 1;
  +                } else {
  +                    found_nonlocal = 1;
  +                }
  +            }
  +            if (found_nonlocal && found_localhost) {
  +                /* Both localhost and non-localhost segments exist. This is a non-functional config.*/
  +                Alarmp( SPLOG_PRINT, PRINT, "Conf_init: Invalid configuration:\n");
  +                Conf_print( &Config );
  +                Alarmp( SPLOG_PRINT, PRINT, "\n");
  +                Alarmp( SPLOG_FATAL, CONF, "Conf_init: Localhost segments can not be used along with regular network address segments.\nMost likely you need to remove or comment out the \nSpread_Segment 127.0.0.255 {...}\n section of your configuration file.\n");
  +            }
  +        }
  +
   	if( my_name == NULL ){
   		gethostname(machine_name,sizeof(machine_name)); 
   		host_ptr = gethostbyname(machine_name);
  
  
  
  1.61      +5 -0      spread/daemon/Readme.txt
  
  Index: Readme.txt
  ===================================================================
  RCS file: /storage/cvsroot/spread/daemon/Readme.txt,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- Readme.txt	24 Sep 2004 14:57:29 -0000	1.60
  +++ Readme.txt	27 Sep 2004 05:15:48 -0000	1.61
  @@ -86,6 +86,11 @@
       This allows easy testing with differing numbers of senders (just change how
       many spflooders start with -ro and how many do not).
   11) Make E_delay() work on Win32. 
  +12) Added check that a segment using localhost (i.e. 127.0.0.255) is NOT in a 
  +    spread.conf with any other segments using real IP addresses. This configuration
  +    will not work correctly and is usually because the example localhost configuration
  +    provided with Spread is added to. This check will cause the daemon to exit 
  +    immediately after parsing the config file.
   
   SOURCE INSTALL:
   ---------------
  
  
  




More information about the Spread-cvs mailing list