]> git.ozlabs.org Git - ppp.git/commitdiff
Minor mods from ppp-new version: request 12-bit BSD-compress by default,
authorPaul Mackerras <paulus@samba.org>
Tue, 6 Jun 1995 01:52:25 +0000 (01:52 +0000)
committerPaul Mackerras <paulus@samba.org>
Tue, 6 Jun 1995 01:52:25 +0000 (01:52 +0000)
better magic number initialization.

pppd/ccp.c
pppd/magic.c

index 0ecfc97e281233099182818c316621580f697732..23fee58446584ece466faafcedd4155ad773feac 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: ccp.c,v 1.9 1995/05/19 03:17:09 paulus Exp $";
+static char rcsid[] = "$Id: ccp.c,v 1.10 1995/06/06 01:52:23 paulus Exp $";
 #endif
 
 #include <syslog.h>
 #endif
 
 #include <syslog.h>
@@ -109,6 +109,7 @@ ccp_init(unit)
     memset(&ccp_allowoptions[unit], 0, sizeof(ccp_options));
     memset(&ccp_hisoptions[unit],   0, sizeof(ccp_options));
 
     memset(&ccp_allowoptions[unit], 0, sizeof(ccp_options));
     memset(&ccp_hisoptions[unit],   0, sizeof(ccp_options));
 
+    ccp_wantoptions[0].bsd_compress = 1;
     ccp_wantoptions[0].bsd_bits = 12;  /* default value */
 
     ccp_allowoptions[0].bsd_compress = 1;
     ccp_wantoptions[0].bsd_bits = 12;  /* default value */
 
     ccp_allowoptions[0].bsd_compress = 1;
index 7391b1405df8a52b7649bd3390f2f24bcd06afc1..4797f0b19fd636f09c357b786b3378c002519ebd 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: magic.c,v 1.4 1995/04/24 05:57:01 paulus Exp $";
+static char rcsid[] = "$Id: magic.c,v 1.5 1995/06/06 01:52:25 paulus Exp $";
 #endif
 
 #include <stdio.h>
 #endif
 
 #include <stdio.h>
@@ -39,14 +39,17 @@ extern void srand48 __P((long));
  * magic_init - Initialize the magic number generator.
  *
  * Attempts to compute a random number seed which will not repeat.
  * magic_init - Initialize the magic number generator.
  *
  * Attempts to compute a random number seed which will not repeat.
- * The current method uses the current hostid and current time, currently.
+ * The current method uses the current hostid, current process ID
+ * and current time, currently.
  */
 void
 magic_init()
 {
     long seed;
  */
 void
 magic_init()
 {
     long seed;
+    struct timeval t;
 
 
-    seed = gethostid() ^ time(NULL);
+    gettimeofday(&t, NULL);
+    seed = gethostid() ^ t.tv_sec ^ t.tv_usec ^ getpid();
     srand48(seed);
 }
 
     srand48(seed);
 }